File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Push Docker Image
2+
3+ env :
4+ DOCKER_BUILDKIT : 1
5+ COMPOSE_DOCKER_CLI_BUILD : 1
6+
7+ on :
8+ push :
9+ branches :
10+ - main
11+
12+ concurrency :
13+ group : ${{ github.head_ref || github.run_id }}
14+ cancel-in-progress : true
15+
16+ jobs :
17+ build-and-push :
18+ runs-on : ubuntu-latest
19+ permissions :
20+ id-token : write
21+ contents : read
22+
23+ steps :
24+ - name : Checkout code
25+ uses : actions/checkout@v5
26+
27+ - uses : docker/login-action@v3
28+ with :
29+ registry : ghcr.io
30+ username : ${{ github.actor }}
31+ password : ${{ secrets.CR_TOKEN }}
32+
33+ - name : Set Docker image tag
34+ id : set-tag
35+ run : |
36+ echo "IMAGE_TAG=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
37+
38+ - name : Build and Push Docker image
39+ working-directory : " ./"
40+ run : |
41+ docker build -t ghcr.io/${{ github.repository }}:${{ steps.set-tag.outputs.IMAGE_TAG }} .
42+ docker push ghcr.io/${{ github.repository }}:${{ steps.set-tag.outputs.IMAGE_TAG }}
You can’t perform that action at this time.
0 commit comments