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