Skip to content

Merge pull request #10 from illumfx/dependabot/pip/backend/pip-14c377… #85

Merge pull request #10 from illumfx/dependabot/pip/backend/pip-14c377…

Merge pull request #10 from illumfx/dependabot/pip/backend/pip-14c377… #85

name: Docker Publish
on:
push:
branches: ["main"]
tags: ["v*"]
workflow_dispatch:
permissions:
contents: read
packages: write
concurrency:
group: docker-publish-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Lowercase owner
id: owner
run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
- name: Extract beta metadata
id: meta-beta
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref_name, '-beta')
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ steps.owner.outputs.owner }}/kuroi-app
tags: |
type=ref,event=tag
type=raw,value=beta-latest
- name: Extract alpha metadata
id: meta-alpha
if: github.ref == 'refs/heads/main'
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ steps.owner.outputs.owner }}/kuroi-app
tags: |
type=raw,value=alpha
type=raw,value=alpha-latest
type=sha,format=short,prefix=alpha-
- name: Extract stable metadata
id: meta-stable
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-beta')
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ steps.owner.outputs.owner }}/kuroi-app
tags: |
type=ref,event=tag
type=raw,value=latest
- name: Build and push beta image
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref_name, '-beta')
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-beta.outputs.tags }}
labels: ${{ steps.meta-beta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VITE_API_BASE_URL=
VITE_OIDC_ENABLED=true
- name: Build and push alpha image
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-alpha.outputs.tags }}
labels: ${{ steps.meta-alpha.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VITE_API_BASE_URL=
VITE_OIDC_ENABLED=true
- name: Build and push stable image
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-beta')
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-stable.outputs.tags }}
labels: ${{ steps.meta-stable.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VITE_API_BASE_URL=
VITE_OIDC_ENABLED=true