feat: 返回spj输出 #81
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: [ master, develop ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
# 8位commit id | |
- uses: benjlevesque/[email protected] | |
id: short-sha | |
with: | |
length: 8 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
registry: registry.cn-shenzhen.aliyuncs.com | |
username: ${{ secrets.DOCKER_REG_USERNAME }} | |
password: ${{ secrets.DOCKER_REG_PASSWORD }} | |
- name: Build and Push Docker images | |
id: docker_build | |
uses: docker/build-push-action@v3 | |
env: | |
OJ_JUDGER_VERSION: ${{ github.ref_name }}-${{ steps.short-sha.outputs.sha }} | |
with: | |
context: ./ | |
push: true | |
build-args: | | |
OJ_JUDGER_VERSION=${{ env.OJ_BE_VERSION }} | |
tags: | | |
registry.cn-shenzhen.aliyuncs.com/szuoj/judge_server:${{ github.ref_name }} | |
registry.cn-shenzhen.aliyuncs.com/szuoj/judge_server:${{ env.OJ_JUDGER_VERSION }} | |
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |