Skip to content

Commit 6b8bae8

Browse files
author
magicpig
committed
Add GitHub Actions workflow for Docker image publishing
1 parent 4a0ca26 commit 6b8bae8

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/update.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish to Dockerhub
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
tags:
10+
description: 'Release Tags'
11+
12+
jobs:
13+
update_dockerhub:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out the repo
17+
uses: actions/checkout@v3
18+
19+
- name: Set up QEMU
20+
uses: docker/setup-qemu-action@v3
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Log in to Docker Hub
26+
uses: docker/login-action@v2
27+
with:
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_PASS }}
30+
31+
- name: Get latest tag
32+
uses: "WyriHaximus/github-action-get-previous-tag@v1"
33+
id: get-latest-tag
34+
with:
35+
fallback: latest
36+
37+
- name: Build and push Docker image
38+
uses: docker/build-push-action@v3
39+
with:
40+
push: true
41+
tags: payment-demo:${{ github.event.inputs.tags || steps.get-latest-tag.outputs.tag }}
42+
file: Dockerfile
43+
platforms: linux/amd64,linux/arm64

0 commit comments

Comments
 (0)