This repository was archived by the owner on Apr 8, 2026. It is now read-only.
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 : Create and publish a docker image
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ branches :
7+ - master
8+ tags :
9+ - ' \d+.\d+.\d+'
10+ pull_request :
11+ branches :
12+ - master
13+
14+ env :
15+ REGISTRY : ghcr.io
16+ IMAGE_NAME : ${{ github.repository }}
17+
18+ jobs :
19+ build :
20+ runs-on : ubuntu-latest
21+
22+ permissions :
23+ contents : read
24+ packages : write
25+
26+ steps :
27+ - name : Checkout repository
28+ uses : actions/checkout@v4
29+
30+ - name : Log in to container registry
31+ uses : docker/login-action@v3
32+ with :
33+ registry : ${{ env.REGISTRY }}
34+ username : ${{ github.actor }}
35+ password : ${{ secrets.GITHUB_TOKEN }}
36+
37+ - name : Extract metadata
38+ id : meta
39+ uses : docker/metadata-action@v5
40+ with :
41+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+ tags : |
43+ type=ref,event=branch
44+ type=ref,event=tag,prefix=v
45+ type=sha
46+
47+ - name : Build and push docker image
48+ uses : docker/build-push-action@v6
49+ with :
50+ context : .
51+ push : ${{ github.event_name != 'pull_request' }}
52+ tags : ${{ steps.meta.outputs.tags }}
53+ labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments