2022-07-15 12:38:43 +00:00
|
|
|
name: Docker publish
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
buildandpush:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
# https://github.com/marketplace/actions/checkout
|
|
|
|
- name: Checkout
|
2023-09-05 06:39:57 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-07-15 12:38:43 +00:00
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
|
2022-07-15 12:54:18 +00:00
|
|
|
# https://github.com/marketplace/actions/get-latest-tag
|
|
|
|
- name: Get latest tag
|
|
|
|
id: latest-tag
|
|
|
|
uses: WyriHaximus/github-action-get-previous-tag@v1
|
|
|
|
|
2022-07-15 12:38:43 +00:00
|
|
|
# https://github.com/booxmedialtd/ws-action-parse-semver
|
|
|
|
- name: Parse version
|
|
|
|
id: semver-version
|
|
|
|
uses: booxmedialtd/ws-action-parse-semver@v1
|
|
|
|
with:
|
2022-07-15 12:54:18 +00:00
|
|
|
input_string: ${{ steps.latest-tag.outputs.tag }}
|
2022-07-15 12:38:43 +00:00
|
|
|
|
|
|
|
# https://github.com/docker/setup-qemu-action#usage
|
|
|
|
- name: Set up QEMU
|
2023-09-13 06:52:19 +00:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-07-15 12:38:43 +00:00
|
|
|
|
|
|
|
# https://github.com/marketplace/actions/docker-setup-buildx
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
# https://github.com/docker/login-action#docker-hub
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
2022-07-15 12:54:18 +00:00
|
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
2022-07-15 12:38:43 +00:00
|
|
|
|
|
|
|
# https://github.com/docker/metadata-action
|
|
|
|
- name: Extract metadata for Docker
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v4
|
|
|
|
with:
|
|
|
|
images: ${{ github.repository }}
|
|
|
|
tags: |
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=pr
|
|
|
|
type=semver,pattern={{major}}.{{minor}}.{{patch}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
|
|
|
|
# https://github.com/docker/build-push-action#multi-platform-image
|
|
|
|
- name: Build and push to Docker Hub
|
2023-01-31 06:06:06 +00:00
|
|
|
uses: docker/build-push-action@v4
|
2022-07-15 12:38:43 +00:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: true
|
2022-11-20 16:29:41 +00:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-07-15 12:38:43 +00:00
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
|
|
|
|
# https://github.com/peter-evans/dockerhub-description
|
|
|
|
- name: Update repo description
|
2022-07-15 12:39:11 +00:00
|
|
|
uses: peter-evans/dockerhub-description@v3
|
2022-07-15 12:38:43 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
|
|
repository: ${{ github.repository }}
|
|
|
|
short-description: ${{ github.event.repository.description }}
|