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 : Build and Push Docker Image
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ release :
7+ types : [ published ]
8+
9+ jobs :
10+ build-and-push :
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : read
14+ packages : write
15+
16+ steps :
17+ - name : Checkout repository
18+ uses : actions/checkout@v4
19+
20+ - name : Log in to GitHub Container Registry
21+ uses : docker/login-action@v3
22+ with :
23+ registry : ghcr.io
24+ username : ${{ github.actor }}
25+ password : ${{ secrets.GITHUB_TOKEN }}
26+
27+ - name : Extract metadata for Docker
28+ id : meta
29+ uses : docker/metadata-action@v5
30+ with :
31+ images : ghcr.io/${{ github.repository }}
32+
33+ - name : Build and push Docker image
34+ uses : docker/build-push-action@v5
35+ with :
36+ context : .
37+ push : true
38+ tags : |
39+ ghcr.io/${{ github.repository }}:latest
40+ ghcr.io/${{ github.repository }}:${{ github.sha }}
41+ labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments