Skip to content

Commit 5082932

Browse files
committed
👷 add Docker publish workflow
1 parent 6ed8383 commit 5082932

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/docker.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
name: Publish Docker image
22

33
on:
4-
workflow_dispatch:
5-
branches:
6-
- master
4+
workflow_call:
75
defaults:
86
run:
97
shell: bash
8+
permissions: read-all
109

1110
jobs:
1211
push_to_registry:
1312
name: Push Docker image to Docker Hub
1413
runs-on: ubuntu-latest
1514
environment:
1615
name: docker
17-
url: https://pypi.org/p/sqlite3-to-mysql
16+
url: https://hub.docker.com/r/klement/sqlite3-to-mysql
1817
steps:
1918
- name: Check out the repo
2019
uses: actions/checkout@v4
@@ -25,6 +24,11 @@ jobs:
2524
images: |
2625
klement/sqlite3-to-mysql
2726
ghcr.io/${{ github.repository }}
27+
tags: |
28+
type=ref,event=branch
29+
type=ref,event=pr
30+
type=semver,pattern={{version}}
31+
type=semver,pattern={{major}}.{{minor}}.{{patch}}
2832
- name: Log in to Docker Hub
2933
uses: docker/login-action@v3
3034
with:
@@ -40,6 +44,5 @@ jobs:
4044
uses: docker/build-push-action@v5
4145
with:
4246
context: .
43-
push: true
4447
tags: ${{ steps.meta.outputs.tags }}
4548
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,8 @@ jobs:
8989
if: ${{ always() }}
9090
run: |
9191
rm -rf dist
92-
rm -rf $CHANGELOG_PATH
92+
rm -rf $CHANGELOG_PATH
93+
docker:
94+
needs: build-and-publish
95+
uses: ./.github/workflows/docker.yml
96+
secrets: inherit

0 commit comments

Comments
 (0)