diff --git a/.github/workflows/image_creation.yaml b/.github/workflows/image_creation.yaml index c4e8d23..33e4d85 100644 --- a/.github/workflows/image_creation.yaml +++ b/.github/workflows/image_creation.yaml @@ -19,11 +19,6 @@ jobs: - name: Set Up BuildX uses: docker/setup-buildx-action@v3 - with: - config-inline: | - [registry."${{ vars.GITEAINSTANCE }}"] - http = true - insecure = true - name: Login to Docker uses: docker/login-action@v3 @@ -31,7 +26,11 @@ jobs: registry: https://git.maximotejeda.com username: ${{ vars.USERNAME }} password: ${{ secrets.PWD }} - + + - name: calculate short sha + run: | + echo "shortsha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Build and push uses: docker/build-push-action@v6 with: @@ -39,3 +38,6 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: git.maximotejeda.com/maximo/ddns:${{ github.ref_name }} + build-args: + - version=${{ github.ref_name}} + - SHORTSHA=${{ steps.vars.outputs.shortsha }} diff --git a/Dockerfile b/Dockerfile index 749db20..02b3b36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM golang:alpine AS builder -ARG TARGETPLATFORM=no-set +ARG BUILDPLATFORM=${BUILDPLATFORM:-linux/amd64} ARG version=not-set ARG SHORTSHA=not-set WORKDIR /app