From 7383721402a026085b2671b9453337435290ddef Mon Sep 17 00:00:00 2001 From: Jeff Smick Date: Sun, 14 Apr 2024 07:50:04 -0700 Subject: [PATCH] update build workflow --- .github/workflows/build.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4b4e06..7e388c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,29 +9,36 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: BuildX Install - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 id: buildx with: install: true - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build - run: | - docker build \ - --platform linux/amd64,linux/arm64 \ - --tag ghcr.io/${{ github.repository }}:${{ github.sha }} \ - --tag ghcr.io/${{ github.repository }}:latest \ - --output "type=image,push=true" \ - . + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}