diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index fe95ab1..773b7e0 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -85,30 +85,24 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract Docker metadata + id: metadata + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=sha,format=long,prefix= + - name: Docker Build uses: docker/build-push-action@v5 with: cache-from: ${{ env.GHCR_REGISTRY_IMAGE }}:latest pull: true + platforms: linux/amd64,linux/arm64 file: docker/Dockerfile - tags: ${{ env.GHCR_REGISTRY_IMAGE }}:${{ github.sha }} + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} push: true build-args: | COMMIT_HASH=${{ github.sha }} - - deploy-docker: - runs-on: ubuntu-latest - needs: - - build-docker - if: github.ref == 'refs/heads/main' - steps: - - name: Login to registry - uses: docker/login-action@v3 - with: - registry: ${{ env.GHCR_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - uses: beeper/docker-retag-push-latest@main - with: - image: ${{ env.GHCR_REGISTRY_IMAGE }}