File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Push Multiarch Image to GHCR
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
8+ branches :
9+ - master
10+
11+ jobs :
12+ build-and-push :
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : read
16+ packages : write # Required for GHCR push
17+
18+ steps :
19+ - name : Checkout repository
20+ uses : actions/checkout@v4
21+
22+ - name : Set up QEMU
23+ uses : docker/setup-qemu-action@v3
24+ with :
25+ platforms : all
26+
27+ - name : Set up Docker Buildx
28+ uses : docker/setup-buildx-action@v3
29+
30+ - name : Log in to GitHub Container Registry
31+ uses : docker/login-action@v3
32+ with :
33+ registry : ghcr.io
34+ username : ${{ github.actor }}
35+ password : ${{ secrets.GITHUB_TOKEN }}
36+
37+ - name : Build and push multiarch image
38+ uses : docker/build-push-action@v6
39+ with :
40+ context : .
41+ platforms : linux/amd64,linux/arm/v7,linux/arm64
42+ push : ${{ github.event_name != 'pull_request' }} # Only push on push, not PR
43+ tags : |
44+ ghcr.io/${{ github.repository }}:latest
45+ ghcr.io/${{ github.repository }}:${{ github.sha }}
You can’t perform that action at this time.
0 commit comments