File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Push
2+
3+ on : push
4+
5+ env :
6+ registry : ghcr.io
7+ image-name : ${{ github.repository }}
8+
9+ jobs :
10+ build-and-push :
11+ runs-on : ubuntu-latest
12+
13+ permissions :
14+ contents : read
15+ packages : write
16+
17+ steps :
18+ - name : Checkout Repository
19+ uses : actions/checkout@v3
20+
21+ - name : Set up Docker Buildx
22+ uses : docker/setup-buildx-action@v2
23+
24+ - name : Determine tags
25+ id : metadata
26+ uses : docker/metadata-action@v4
27+ with :
28+ images : ${{ env.registry }}/${{ env.image-name }}
29+ tags : |
30+ type=sha,prefix=,format=long
31+ type=schedule
32+ type=ref,event=branch
33+ type=ref,event=pr
34+ type=raw,value=latest,enable={{ is_default_branch }}
35+
36+ - name : Log in to the Container registry
37+ uses : docker/login-action@v2.1.0
38+ with :
39+ registry : ${{ env.registry }}
40+ username : ${{ github.actor }}
41+ password : ${{ secrets.GITHUB_TOKEN }}
42+
43+ - name : Build and push ${{ env.image-name }}
44+ uses : docker/build-push-action@v3
45+ with :
46+ push : true
47+ tags : ${{ steps.metadata.outputs.tags }}
48+ labels : ${{ steps.metadata.outputs.labels }}
49+ cache-from : type=gha
50+ cache-to : type=gha,mode=max
51+
52+ concurrency :
53+ group : ${{ github.ref }}
54+ cancel-in-progress : true
You can’t perform that action at this time.
0 commit comments