File tree Expand file tree Collapse file tree 2 files changed +57
-43
lines changed
Expand file tree Collapse file tree 2 files changed +57
-43
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches :
6+ - ' **'
7+ tags :
8+ - ' *'
9+
10+ jobs :
11+ build-and-push :
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v4
17+
18+ - name : Set up Go
19+ uses : actions/setup-go@v5
20+ with :
21+ go-version : ' 1.17'
22+
23+ - name : Build binary
24+ run : |
25+ GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o bin/surtr
26+
27+ - name : Set up Docker Buildx
28+ uses : docker/setup-buildx-action@v3
29+
30+ - name : Log in to Quay.io
31+ uses : docker/login-action@v3
32+ with :
33+ registry : quay.io
34+ username : ${{ secrets.DOCKER_USERNAME }}
35+ password : ${{ secrets.DOCKER_PASSWORD }}
36+
37+ - name : Extract metadata for Docker
38+ id : meta
39+ uses : docker/metadata-action@v5
40+ with :
41+ images : quay.io/uswitch/surtr
42+ tags : |
43+ # For branch pushes: tag with SHA and branch name
44+ type=sha,prefix=
45+ type=ref,event=branch
46+ # For tags: tag with the git tag
47+ type=ref,event=tag
48+ # For master branch: also tag as latest
49+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
50+
51+ - name : Build and push Docker image
52+ uses : docker/build-push-action@v5
53+ with :
54+ context : .
55+ push : true
56+ tags : ${{ steps.meta.outputs.tags }}
57+ labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments