Skip to content

Commit 4897601

Browse files
committed
build for published image
1 parent 48d38b6 commit 4897601

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build published docker image
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
#--- Set permissions to ephemeral GITHUB_TOKEN for job actions
16+
permissions:
17+
contents: read
18+
packages: write
19+
20+
steps:
21+
- name: Checkout and download repository to workflow runner
22+
uses: actions/checkout@v4
23+
24+
- name: Set up docker builder
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Login to github container registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Get metadata from docker image
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39+
40+
- name: Build and push image to github container registry
41+
uses: docker/build-push-action@v5
42+
with:
43+
context: .
44+
load: true
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)