Skip to content

Commit

Permalink
Update build-pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gitworkflows authored Sep 6, 2024
1 parent 5ea2673 commit da4b78b
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
platform:
- linux/amd64
- linux/arm64
# - linux/arm/v7
# - linux/arm/v7 # Uncomment if you need ARMv7 support
steps:
- name: 📥 Checkout the git repo
uses: actions/checkout@v4
Expand All @@ -36,13 +36,29 @@ jobs:
type=sha,prefix=sha-
type=ref,event=branch
type=ref,event=pr
- name: 🏗️ Build Docker image
uses: docker/build-push-action@v5
with:
context: web/
platforms: ${{ matrix.platform }}
push: false
push: false # Only build, don't push to Docker Hub yet
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: 🔐 Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: 📤 Push Docker image to Docker Hub
uses: docker/build-push-action@v5
with:
context: web/
platforms: ${{ matrix.platform }}
push: true # Push to Docker Hub
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down

0 comments on commit da4b78b

Please sign in to comment.