Skip to content

Commit c4d7970

Browse files
committed
👷 add Docker publish workflow
1 parent 3f6507a commit c4d7970

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/docker.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish Docker image
2+
3+
on:
4+
workflow_dispatch:
5+
branches:
6+
- master
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
jobs:
12+
push_to_registry:
13+
name: Push Docker image to Docker Hub
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out the repo
17+
uses: actions/checkout@v4
18+
- name: Docker meta
19+
id: meta
20+
uses: docker/metadata-action@v5
21+
with:
22+
images: |
23+
klement/sqlite3-to-mysql
24+
ghcr.io/${{ github.repository }}
25+
- name: Log in to Docker Hub
26+
uses: docker/login-action@v3
27+
with:
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_TOKEN }}
30+
- name: Log in to the Container registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Build and push
37+
uses: docker/build-push-action@v5
38+
with:
39+
context: .
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)