GitNexus/.github/workflows/devcontainer-publish.yml
Gergő Magyar b961e695ca
Some checks failed
Devcontainer Smoke / Config-transform unit tests (push) Has been cancelled
Devcontainer Smoke / Build devcontainer image (default) (push) Has been cancelled
Publish Development Images / publish (core) (push) Has been cancelled
Publish Development Images / publish (ui) (push) Has been cancelled
Devcontainer Smoke / Build devcontainer image (ui) (push) Has been cancelled
CodeQL / Analyze (python) (push) Waiting to run
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
Gitleaks / gitleaks (push) Waiting to run
Publish / ci (push) Blocked by required conditions
Publish / Classify release event (push) Waiting to run
Publish / RC guard (marker + release-PR skip) (push) Blocked by required conditions
Publish / Publish to npm (push) Blocked by required conditions
Publish / Build & Push RC Docker images (push) Blocked by required conditions
Scorecard / Scorecard analysis (push) Waiting to run
Skill copy sync / shipped skills drift guard (push) Waiting to run
Trivy Image Scan / Trivy (gitnexus-cli) (push) Waiting to run
Trivy Image Scan / Trivy (gitnexus-web) (push) Waiting to run
fix(devcontainer): refresh Node and streamline development (#3610)
2026-10-17 21:05:13 +00:00

75 lines
2.7 KiB
YAML

name: Publish Development Images
on:
push:
branches: [main]
paths:
- '.devcontainer/**'
- 'gitnexus-web/package-lock.json'
- '.github/workflows/devcontainer-publish.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
profile: [core, ui]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
- name: Verify development tooling before publishing
run: |
npm ci --no-audit --no-fund
node --test .devcontainer/*.test.cjs
- uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate toolchain-only configuration
env:
PROFILE: ${{ matrix.profile }}
run: |
if [ "$PROFILE" = ui ]; then
node .devcontainer/profile.cjs image-build --ui
else
node .devcontainer/profile.cjs image-build
fi
- name: Build both architectures, cache and publish
env:
PROFILE: ${{ matrix.profile }}
run: |
set -euo pipefail
image="ghcr.io/${GITHUB_REPOSITORY,,}-devcontainer"
suffix=""
if [ "$PROFILE" = ui ]; then suffix="-ui"; fi
tag="${image}:sha-${GITHUB_SHA}-run-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}${suffix}"
cache="${image}:buildcache-${PROFILE}"
npx --yes @devcontainers/cli@0.87.0 build \
--workspace-folder . --config .devcontainer/generated/devcontainer.json \
--frozen-lockfile --platform linux/amd64,linux/arm64 \
--image-name "$tag" --push true \
--label "org.opencontainers.image.source=https://github.com/${GITHUB_REPOSITORY}" \
--cache-from "$cache" --cache-to "type=registry,ref=${cache},mode=max"
docker buildx imagetools create --tag "${image}:main${suffix}" "$tag"
echo "Published ${tag}" >> "$GITHUB_STEP_SUMMARY"