Skip to content

Modern Docker Management, Designed for Everyone

2.6 KB
Raw Blame
name: Build CI Image

# Build this image successfully before activating its consumers.
on:
  workflow_dispatch:
  push:
    branches: [main]
    paths:
      - '.depot/workflows/**'
      - '.depot/actions/publish-images/action.yml'
      - 'pnpm-lock.yaml'
      - 'tests/package.json'
  schedule:
    - cron: '17 4 * * 1'

permissions:
  contents: read

concurrency:
  group: build-ci-image
  cancel-in-progress: false

defaults:
  run:
    shell: bash

jobs:
  build-image:
    if: github.repository == 'getarcaneapp/arcane' && github.ref == 'refs/heads/main'
    runs-on: depot-ubuntu-24.04-4
    timeout-minutes: 15
    steps:
      - name: Checkout code
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

      - name: Setup Vite+
        uses: voidzero-dev/setup-vp@cab1ab9eaff52d4857875f4f2c016e36af8f2c76 # v1.22.0
        with:
          node-version: 26
          cache: true
          run-install: false

      - name: Install E2E test dependencies
        run: vp -C tests install

      - name: Install GCC and envsubst
        run: |
          sudo apt-get update
          sudo apt-get install -y gcc gettext-base

      - name: Install version tools
        uses: taiki-e/install-action@5488ac5a951645ce95062214902ac4b6bc1a1037 # v2.87.32
        with:
          tool: just,git-cliff
          fallback: none

      - name: Install cosign
        uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2

      - name: Put standalone tools on the default PATH
        run: |
          for tool in just git-cliff cosign; do
            source="$(command -v "$tool")"
            if [[ "$source" != "/usr/local/bin/$tool" ]]; then
              sudo install -m 0755 "$source" "/usr/local/bin/$tool"
            fi
          done

      - name: Pre-pull test images
        retry: 2
        timeout-minutes: 5
        run: |
          export DOCKER_CONFIG="$(mktemp -d)"
          trap 'rm -rf "$DOCKER_CONFIG"' EXIT
          printf '%s' "$DEPOT_TOKEN" | docker login g7r5wqb57k.registry.depot.dev --username x-token --password-stdin
          version="$(vp -C tests exec node -p 'require("@playwright/test/package.json").version')"
          docker pull public.ecr.aws/nginx/nginx:stable-alpine
          docker pull public.ecr.aws/docker/library/busybox:1.37
          docker pull "g7r5wqb57k.registry.depot.dev/mirrors/playwright:v$version-noble"

      - name: Snapshot CI image
        uses: depot/snapshot-action@a082cbabd407afdf324a7b4f41889795636f4b24 # v1.2.1
        with:
          image: g7r5wqb57k.registry.depot.dev/ci:latest
          env-mask: |
            DEPOT_SNAPSHOT_TOKEN
            DEPOT_TOKEN