JudgeServer/.github/workflows/release.yml

55 lines
1.4 KiB
YAML
Raw Normal View History

2024-01-29 04:30:52 +00:00
name: Release build
on:
push:
tags:
- v**
workflow_dispatch:
2024-01-29 04:30:52 +00:00
jobs:
build:
runs-on: ubuntu-latest
environment: release
2024-01-29 04:30:52 +00:00
permissions:
contents: read
packages: write
steps:
- name: Docker metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: |
registry.cn-hongkong.aliyuncs.com/oj-image/judge
2024-01-29 04:30:52 +00:00
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: Login to Aliyun Container Registry
uses: docker/login-action@v3
with:
registry: registry.cn-hongkong.aliyuncs.com
username: ${{ secrets.ALIYUN_ACR_USERNAME }}
password: ${{ secrets.ALIYUN_ACR_PASSWORD }}
2024-01-29 04:30:52 +00:00
- 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 }}