1+ name : " Release Gofer CLI Docker Image"
2+ on :
3+ workflow_dispatch : # Allow manual trigger
4+ push :
5+ tags :
6+ - v[0-9]+.[0-9]+.[0-9]+
7+ - v[0-9]+.[0-9]+.[0-9]+-[0-9]+
8+ - v[0-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+
9+
10+ jobs :
11+ build-and-push :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Checkout
15+ uses : actions/checkout@v3
16+
17+ - name : Docker metadata
18+ uses : docker/metadata-action@v3
19+ id : meta
20+ with :
21+ images : ghcr.io/chronicleprotocol/gofer-cli
22+ tags : |
23+ type=semver,pattern={{version}}
24+ type=semver,pattern={{major}}.{{minor}}
25+ type=semver,pattern={{major}}
26+ type=sha
27+
28+ - name : Set up QEMU
29+ uses : docker/setup-qemu-action@master
30+ with :
31+ platforms : all
32+
33+ - name : Set up Docker Buildx
34+ uses : docker/setup-buildx-action@v2
35+ id : buildx
36+ with :
37+ install : true
38+
39+ - name : Login to Github Packages
40+ uses : docker/login-action@v2
41+ with :
42+ registry : ghcr.io
43+ username : ${{ github.actor }}
44+ password : ${{ secrets.GITHUB_TOKEN }}
45+
46+ - name : Build and push
47+ uses : docker/build-push-action@v4
48+ with :
49+ context : .
50+ file : ./Dockerfile-gofer
51+ platforms : linux/amd64,linux/arm64
52+ push : ${{ github.event_name != 'pull_request' }}
53+ tags : ${{ steps.meta.outputs.tags }}
54+ labels : ${{ steps.meta.outputs.labels }}
55+ cache-from : type=gha
56+ cache-to : type=gha,mode=max
0 commit comments