Skip to content

Commit

Permalink
Merge pull request #83 from muonsoft/docker-tags-fix
Browse files Browse the repository at this point in the history
fix: docker semver tags
  • Loading branch information
strider2038 authored Nov 30, 2022
2 parents eb6f24e + b0e39c1 commit 6ad8cd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set APP_VERSION env
run: echo "APP_VERSION=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev )" >> $GITHUB_ENV
Expand All @@ -32,7 +35,8 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand All @@ -41,7 +45,7 @@ jobs:
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
push: ${{ github.event_name != 'pull_request' }}
pull: true
build-args: |
APP_VERSION=${{ env.APP_VERSION }}
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ FROM --platform=$BUILDPLATFORM golang:alpine AS build-env

ARG APP_VERSION=""
ARG BUILD_TIME=""
ARG TARGETOS TARGETARCH
ARG TARGETOS
ARG TARGETARCH

ADD . /project

Expand Down

0 comments on commit 6ad8cd8

Please sign in to comment.