Skip to content

Commit d569f4c

Browse files
Tom LarkworthyTom Larkworthy
authored andcommitted
Save content for docker push workflow file
1 parent 9ca2d93 commit d569f4c

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/dockerhub.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish Docker image
2+
on:
3+
push:
4+
branches: ['release']
5+
6+
env:
7+
REGISTRY: ghcr.io
8+
IMAGE_NAME: ${{ github.repository }}
9+
10+
jobs:
11+
build-and-push-image:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
21+
- name: Log in to the Container registry
22+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
23+
with:
24+
registry: ${{ env.REGISTRY }}
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Extract metadata (tags, labels) for Docker
29+
id: meta
30+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
31+
with:
32+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33+
34+
- name: Build and push Docker image
35+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
36+
with:
37+
context: .
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)