mirror of
https://github.com/mermaid-js/mermaid-live-editor.git
synced 2026-11-04 08:59:08 +00:00
The multi-platform Docker build ran pnpm install and pnpm build for
linux/arm64 under QEMU emulation. QEMU intermittently crashes there
("qemu: uncaught target signal 4 (Illegal instruction)") or stalls, and
buildkit then waits until GitHub cancels the job at 6 hours: 16
cancelled runs in September, including a develop push.
The build output is a static site, identical on every architecture, so
the node stages now run on $BUILDPLATFORM and only the nginx stage
(COPY only) is built per architecture. Also caps the job at 30 minutes
so any future hang fails fast.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
name: Docker
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
# Publish `master` as Docker `latest` image.
|
|
- master
|
|
# Publish `develop` as Docker `nightly` image.
|
|
- develop
|
|
|
|
# Run tests for all PRs to master and develop.
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- develop
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
# A healthy build takes a few minutes; fail fast instead of hanging for 6 hours.
|
|
timeout-minutes: 30
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
attestations: write
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: docker/setup-qemu-action@v3
|
|
- uses: docker/setup-buildx-action@v3
|
|
- name: Login to GitHub Container Registry
|
|
if: github.event_name == 'push'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: docker/metadata-action@v5
|
|
id: meta
|
|
with:
|
|
images: ghcr.io/${{ github.repository }}
|
|
tags: |
|
|
type=raw,value=latest,enable=${{ github.ref_name == 'master' }}
|
|
type=raw,value=nightly,enable=${{ github.ref_name == 'develop' }}
|
|
- uses: docker/build-push-action@v5
|
|
id: build
|
|
with:
|
|
context: .
|
|
target: mermaid
|
|
push: ${{ github.event_name == 'push' }}
|
|
platforms: linux/amd64,linux/arm64
|
|
pull: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
- name: Generate Build Attestation
|
|
uses: actions/attest-build-provenance@v2
|
|
with:
|
|
subject-name: ghcr.io/${{ github.repository }}
|
|
subject-digest: ${{ steps.build.outputs.digest }}
|
|
push-to-registry: true
|
|
if: github.event_name == 'push'
|