Skip to content

以 rust:latest 为基础镜像,手动安装 go gcc #6

以 rust:latest 为基础镜像,手动安装 go gcc

以 rust:latest 为基础镜像,手动安装 go gcc #6

name: Challenge online_judge
on:
push:
branches: ["main"]
paths:
- "!**/README.md"
- "challenges/ppc/online_judge/build/**"
workflow_dispatch:
env:
TYPE: ppc
NAME: online_judge
REGISTRY: ghcr.io
jobs:
challenge-build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Compile
run: |
cd challenges/${{ env.TYPE }}/${{ env.NAME }}/build
cargo build --release
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.NAME }}
tags: |
latest
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: challenges/${{ env.TYPE }}/${{ env.NAME }}/build
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true