Skip to content

Commit 46e2bc8

Browse files
committed
ci: add GitHub Actions workflow for Docker image publishing
1 parent 5d9ac5a commit 46e2bc8

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Version Bump and Docker Publish
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- master
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
packages: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Bump version and push tag
19+
id: tag_version
20+
uses: mathieudutour/[email protected]
21+
with:
22+
github_token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Create a GitHub release
25+
uses: ncipollo/release-action@v1
26+
with:
27+
tag: ${{ steps.tag_version.outputs.new_tag }}
28+
name: Release ${{ steps.tag_version.outputs.new_tag }}
29+
body: ${{ steps.tag_version.outputs.changelog }}
30+
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v2
33+
with:
34+
platforms: amd64,arm64
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v2
38+
39+
- name: Login to DockerHub
40+
uses: docker/login-action@v2
41+
with:
42+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
43+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
44+
45+
- name: Build and Push Docker image
46+
uses: docker/build-push-action@v4
47+
with:
48+
context: .
49+
push: true
50+
platforms: linux/amd64,linux/arm64
51+
tags: |
52+
charlessortlist/pg-repack-docker:latest
53+
charlessortlist/pg-repack-docker:${{ steps.tag_version.outputs.new_tag }}

0 commit comments

Comments
 (0)