Skip to content

Commit cd0b393

Browse files
committed
Added docker image workflow
1 parent a8dd6a5 commit cd0b393

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/publish_docker.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish Docker image
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
push_to_registries:
10+
name: Push Docker image to multiple registries
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
packages: write
15+
contents: read
16+
17+
steps:
18+
- name: Check out the repo
19+
uses: actions/checkout@v4
20+
21+
- name: Log in to the Container registry
22+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
23+
with:
24+
registry: ghcr.io
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@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
31+
with:
32+
images: |
33+
ghcr.io/${{ github.repository }}
34+
35+
- name: Build and push Docker images
36+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
37+
with:
38+
context: .
39+
push: ${{ github.event_name == 'release' }}
40+
tags: ${{ steps.meta.outputs.tags }}
41+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)