File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ on :
2+ push :
3+ branches :
4+ - main
5+ tags :
6+ - ' v*'
7+
8+ name : build container image
9+
10+ jobs :
11+ build :
12+ name : Build container image
13+ runs-on : ubuntu-latest
14+ steps :
15+ -
16+ name : Checkout code
17+ uses : actions/checkout@v2
18+ -
19+ name : Set up QEMU
20+ uses : docker/setup-qemu-action@v1
21+ -
22+ name : Set up Docker Buildx
23+ uses : docker/setup-buildx-action@v1
24+ -
25+ name : Login to GitHub Container Registry
26+ uses : docker/login-action@v1
27+ with :
28+ registry : ghcr.io
29+ username : ${{ github.repository_owner }}
30+ password : ${{ secrets.GITHUB_TOKEN }}
31+ -
32+ name : Build and push development container image
33+ if : ${{ startsWith(github.ref, 'refs/heads/') }}
34+ uses : docker/build-push-action@v2
35+ with :
36+ context : .
37+ file : ./Dockerfile
38+ platforms : linux/amd64, linux/arm64
39+ push : true
40+ tags : |
41+ ghcr.io/rancher-sandbox/lockc:latest
42+ -
43+ name : Retrieve tag name
44+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
45+ run : |
46+ echo TAG_NAME=$(echo $GITHUB_REF | sed -e "s|refs/tags/||") >> $GITHUB_ENV
47+ -
48+ name : Build and push tagged container image
49+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
50+ uses : docker/build-push-action@v2
51+ with :
52+ context : .
53+ file : ./Dockerfile
54+ platforms : linux/amd64
55+ push : true
56+ tags : |
57+ ghcr.io/rancher-sandbox/lockc:${{ env.TAG_NAME }}
You can’t perform that action at this time.
0 commit comments