File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ name : build-image
2+
3+ on :
4+ push :
5+ tags :
6+ - ' [0-9]+.[0-9]+.[0-9]+'
7+
8+ jobs :
9+ build-and-push :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Check out code
13+ uses : actions/checkout@v4
14+
15+ - name : Set up version variables
16+ id : vars
17+ run : |
18+ VERSION=${{ github.ref_name}}
19+ MAJOR=$(echo $VERSION | cut -d. -f1)
20+ MINOR=$(echo $VERSION | cut -d. -f2)
21+ echo "MAJOR=$MAJOR" >> $GITHUB_ENV
22+ echo "MINOR=$MINOR" >> $GITHUB_ENV
23+
24+ - name : Log in to GHCR
25+ uses : docker/login-action@v3
26+ with :
27+ registry : ghcr.io
28+ username : ${{ github.actor }}
29+ password : ${{ secrets.GITHUB_TOKEN }}
30+
31+ - name : Set up Docker Buildx
32+ uses : docker/setup-buildx-action@v3
33+
34+ - name : Build and push Docker image
35+ uses : docker/build-push-action@v6
36+ with :
37+ context : .
38+ file : Containerfile
39+ push : true
40+ sbom : true
41+ build-args : |
42+ GITLAB_SYNC_VERSION=${{ github.ref_name }}
43+ tags : |
44+ ghcr.io/${{ github.repository }}:${{ github.ref_name}}
45+ ghcr.io/${{ github.repository }}:${{ env.MAJOR }}.${{ env.MINOR }}
46+ ghcr.io/${{ github.repository }}:latest
You can’t perform that action at this time.
0 commit comments