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+ push :
5+ branches : ['master']
6+ tags : ['*.*.*']
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+ permissions :
17+ contents : read
18+ packages : write
19+
20+ steps :
21+ - name : Checkout repository
22+ uses : actions/checkout@v3
23+
24+ - name : Log in to the Container registry
25+ uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
26+ with :
27+ registry : ${{ env.REGISTRY }}
28+ username : ${{ github.actor }}
29+ password : ${{ secrets.GITHUB_TOKEN }}
30+
31+ - name : Extract metadata (tags, labels) for Docker
32+ id : meta
33+ uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
34+ with :
35+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
36+
37+ - name : Build and push Docker image
38+ uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
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