Merge pull request #112 from comprofix/workflow

Updated workflow for release tagging
This commit is contained in:
Tigerblue77 2025-10-26 17:56:57 +01:00 committed by GitHub
commit 2b8c97fe1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,60 +2,60 @@ name: Docker image CI
on: on:
push: push:
branches: [ master ] tags: ["v[0-9]+.[0-9]+"]
paths-ignore: paths-ignore:
- '**/README.md' - "**/README.md"
jobs: jobs:
build: build:
name: Build and publish Docker image to Docker Hub and GitHub Containers Repository name: Build and publish Docker image to Docker Hub and GitHub Containers Repository
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Remove "_Docker" suffix from GitHub repository name to use it as image name - name: Generate release note
uses: mad9000/actions-find-and-replace-string@3 uses: softprops/action-gh-release@v1
id: docker_image_name with:
with: generate_release_notes: true
source: ${{ github.repository }}
find: '_Docker'
replace: ''
- name: Docker meta - name: Docker meta
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
images: | images: |
${{ steps.docker_image_name.outputs.value }} ${{ github.repository | replace('_Docker', '') }}
ghcr.io/${{ steps.docker_image_name.outputs.value }} ghcr.io/${{ github.repository | replace('_Docker', '') }}
tags: type=raw,value=latest tags: |
type=ref,event=tag
flavor: |
latest=auto
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Build and publish Docker image - name: Build and publish Docker image
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
with: with:
context: . context: .
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
file: ./Dockerfile file: ./Dockerfile
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}