File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Latest Docker Image
2+
3+ permissions :
4+ packages : write
5+ contents : read
6+
7+ on :
8+ push :
9+ branches :
10+ - main
11+
12+ env :
13+ ORG : ' sprintertech'
14+ REGISTRY : ' ghcr.io'
15+
16+ jobs :
17+ build-and-push :
18+ runs-on : ubuntu-latest
19+ steps :
20+ # Checkout the repository
21+ - name : Checkout code
22+ uses : actions/checkout@v4
23+
24+ # Log in to GHCR
25+ - name : Log in to GHCR
26+ id : ghcr
27+ uses : docker/login-action@v3
28+ with :
29+ registry : ${{ env.REGISTRY }}
30+ username : ${{ github.actor }}
31+ password : ${{ secrets.GITHUB_TOKEN }}
32+
33+
34+ # Build and push the Docker image
35+ - name : Build and push Docker image
36+ uses : docker/build-push-action@v5
37+ with :
38+ context : .
39+ push : true
40+ # Pass build arguments for the GitHub credentials
41+ build-args : |
42+ GH_USER_NAME=${{ secrets.GH_USER_NAME }}
43+ GH_USER_TOKEN=${{ secrets.GHCR_TOKEN }}
44+ tags : |
45+ ${{ env.REGISTRY }}/${{ github.repository }}:latest
You can’t perform that action at this time.
0 commit comments