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