File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish Docker image
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ tags : [ 'v*' ]
7+
8+ env :
9+ REGISTRY : ghcr.io
10+ IMAGE_NAME : ${{ github.repository }}
11+
12+ jobs :
13+ build-and-push-image :
14+ runs-on : ubuntu-latest
15+ permissions :
16+ contents : read
17+ packages : write
18+ steps :
19+ - name : Checkout repository
20+ uses : actions/checkout@v3
21+ - name : Log in to the Container registry
22+ uses : docker/login-action@v2
23+ with :
24+ registry : ghcr.io
25+ username : ${{ github.actor }}
26+ password : ${{ secrets.GITHUB_TOKEN }}
27+ - name : Docker meta
28+ id : meta
29+ uses : docker/metadata-action@v4
30+ with :
31+ images : ghcr.io/${{ github.repository }}
32+ tags : |
33+ # set latest tag for default branch
34+ type=raw,value=latest,enable={{is_default_branch}}
35+ # tag event
36+ type=ref,event=tag
37+ - name : Build and push Docker image
38+ uses : docker/build-push-action@v3
39+ with :
40+ context : .
41+ push : true
42+ tags : ${{ steps.meta.outputs.tags }}
43+ labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments