feat(ci): add release build CI

This commit is contained in:
Mikucat 2024-02-04 18:31:25 +08:00
parent 7370cec5a8
commit 032bf201b4
No known key found for this signature in database
GPG Key ID: CE6B09A6F462E04D

46
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: Release build
on:
release:
types:
- published
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Docker metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/qingdaou/oj-frontend
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- 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: Build and push
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.metadata.outputs.tags }}
annotations: ${{ steps.metadata.outputs.annotations }}