File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-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+ tags :
6+ - " v*"
7+ workflow_dispatch :
8+
9+ env :
10+ REGISTRY : ghcr.io
11+ IMAGE_NAME : ${{ github.repository }}
12+
13+ jobs :
14+ build-and-push-image :
15+ runs-on : ubuntu-latest
16+ environment : publishing
17+ permissions :
18+ contents : read
19+ packages : write
20+
21+ steps :
22+ - name : Checkout repository
23+ uses : actions/checkout@v3
24+
25+ - name : Log in to the Container registry
26+ uses : docker/login-action@v2
27+ with :
28+ registry : ${{ env.REGISTRY }}
29+ username : ${{ github.actor }}
30+ password : ${{ secrets.GITHUB_TOKEN }}
31+
32+ - name : Extract metadata (tags, labels) for Docker
33+ id : meta
34+ uses : docker/metadata-action@v4
35+ with :
36+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
37+ tags : |
38+ type=semver,pattern={{version}}
39+ latest
40+
41+ - name : Build and push Docker image
42+ uses : docker/build-push-action@v4
43+ with :
44+ context : .
45+ file : ./Dockerfile
46+ push : true
47+ tags : ${{ steps.meta.outputs.tags }}
48+ labels : ${{ steps.meta.outputs.labels }}
49+ cache-from : type=gha
50+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments