bump r19 #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker Image | |
on: | |
workflow_dispatch: | |
push: | |
branches: main | |
paths: CHANGELOG.md | |
jobs: | |
publish: | |
name: Publish Docker Image to ghcr.io | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Extract version number | |
run: | | |
VERSION=$(grep -oP -m 1 '(?<=^## r)\d+' CHANGELOG.md) | |
if [[ $VERSION = "" ]]; then | |
echo "No version found in CHANGELOG.md" | |
exit 1 | |
fi | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Check if version already exists in registry | |
run: | | |
if docker manifest inspect ghcr.io/${{ github.repository }}:0.0.$VERSION > /dev/null 2>&1; then | |
echo "Image with version 0.0.$VERSION already exists in registry" | |
exit 1 | |
fi | |
- name: Log in to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}:0.0.${{ env.VERSION }} | |
ghcr.io/${{ github.repository }}:latest | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 |