skillhub/.github/workflows/riscv64-images.yml
FenjuFu f846da230c
Some checks failed
Security / Dependency Review (push) Waiting to run
Security / CodeQL (java-kotlin) (push) Waiting to run
Security / CodeQL (javascript-typescript) (push) Waiting to run
Security / CodeQL (python) (push) Waiting to run
Deploy Docs / build (push) Has been cancelled
Deploy Docs / Deploy (push) Has been cancelled
feat: add initial RISC-V image support (#725)
* feat: add initial RISC-V image support

Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>

* chore(ci): tighten riscv64 image guardrails

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>

---------

Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
Co-authored-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
2026-08-24 16:37:34 +08:00

65 lines
1.8 KiB
YAML

name: RISC-V Images
on:
pull_request:
paths:
- '.github/workflows/riscv64-images.yml'
- '.github/workflows/publish-images.yml'
- 'server/**'
- 'web/**'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build ${{ matrix.name }} (linux/riscv64)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: server
context: ./server
dockerfile: ./server/Dockerfile
- name: web
context: ./web
dockerfile: ./web/Dockerfile
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: riscv64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build RISC-V image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
platforms: linux/riscv64
load: true
tags: skillhub-${{ matrix.name }}:riscv64-ci
cache-from: type=gha,scope=riscv64-${{ matrix.name }}
cache-to: type=gha,mode=max,scope=riscv64-${{ matrix.name }}
- name: Verify image architecture and runtime
shell: bash
run: |
image="skillhub-${{ matrix.name }}:riscv64-ci"
test "$(docker image inspect "$image" --format '{{.Architecture}}')" = riscv64
case "${{ matrix.name }}" in
server)
docker run --rm --platform linux/riscv64 --entrypoint java "$image" -version
;;
web)
docker run --rm --platform linux/riscv64 --entrypoint nginx "$image" -v
;;
esac