airi/.github/workflows/release-docker.yaml

53 lines
1.5 KiB
YAML

name: Release Docker / OCI
on:
push:
tags:
- '**'
workflow_dispatch:
jobs:
ghcr_build:
name: Release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# Why?
#
# failed to build archive at `/home/runner/work/airi/airi/target/x86_64-unknown-linux-gnu/release/deps/libapp_lib.rlib`:
# No space left on device (os error 28)
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
- uses: actions/checkout@v5
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
flavor: |
latest=true
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: ./
file: ./apps/stage-web/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm64/v8
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}