From 032bf201b4d22b5eb4fc8ec0886b9252e6c9abc3 Mon Sep 17 00:00:00 2001 From: Mikucat Date: Sun, 4 Feb 2024 18:31:25 +0800 Subject: [PATCH] feat(ci): add release build CI --- .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..81acbf0 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }}