Skip to content

πŸ”€ Merge pull request #10 from jyje/develop #13

πŸ”€ Merge pull request #10 from jyje/develop

πŸ”€ Merge pull request #10 from jyje/develop #13

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract tag name
run: echo "image_version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Check tag format
run: |
TAG_NAME="${{ env.image_version }}"
if ! [[ "$TAG_NAME" =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then
echo "Tag $TAG_NAME does not meet the required format 'vX.Y.Z'."
exit 1
fi
- name: Publish as GitHub Package
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.image_version }}
- name: Create Release
if: success()
uses: ncipollo/release-action@v1
with:
tag: ${{ env.image_version }}
name: Release ${{ env.image_version }}
token: ${{ secrets.GITHUB_TOKEN }}