Communitygithub.com

Nuvraxis/nuvraxis-plugins

Nuvraxis Next.js 앱을 위한 GitHub Actions 규칙 — 정확히 세 가지 워크플로우(pr.yaml, main.yaml, release.yaml) 제공. 최소 권한, GITHUB_TOKEN만 사용, 액션 메이저 버전 고정.

nuvraxis-plugins란 무엇인가요?

이 스킬은 Nuvraxis Next.js 애플리케이션을 위한 세 가지 표준 GitHub Actions 워크플로우(pr.yaml, main.yaml, release.yaml)를 정의합니다. pr.yaml은 모든 PR에 대해 Biome 린터, stylelint, 타입체크/테스트/빌드(turbo --affected), Docker 빌드 + 헬스 체크, helm lint + kubeconform을 실행하지만 아무것도 퍼블리시하지 않습니다. main.yaml은 main 브랜치 푸시 시 멀티 아키텍처 이미지를 GHCR에 빌드하고 푸시하며, sha-SHORTSHA와 main 태그를 지정하고, provenance 및 SBOM을 포함하며 GHA 캐시를 사용합니다. release.yaml은 vX.Y.Z 태그 푸시 시 main에서 태그가 유효한지 확인한 후, 기존 이미지를 재빌드 없이 리태깅하고, Helm 차트를 OCI로 패키징 및 푸시하며, GitHub Release를 생성합니다. 각 작업은 최소 권한으로 설정되고, GITHUB_TOKEN만 사용하며, 모든 액션은 메이저 버전으로 고정됩니다. 이 스킬은 .github/workflows/* 파일을 편집하거나, CI 단계를 추가하거나, 실패한 실행 또는 릴리스를 디버깅할 때 유용합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Nuvraxis/nuvraxis-plugins/tree/HEAD/plugins/nuvraxis-frontend/skills/github-actions

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

GitHub Actions

앱당 세 개의 워크플로우, 각각 하나의 작업으로 구성됩니다. 템플릿의 .github/workflows/{pr,main,release}.yaml이 진실의 원천(source of truth)이며, references/workflows.md에 설명과 함께 재현되어 있습니다.

pull request ──► pr.yaml       검사만 수행, 아무것도 퍼블리시하지 않음
merge to main ─► main.yaml     이미지 한 번 빌드 → ghcr.io/nuvraxis/<app>:sha-<short>, :main
tag vX.Y.Z ────► release.yaml  동일한 이미지 리태깅 :vX.Y.Z, :latest · 차트 X.Y.Z → OCI · GitHub Release

모든 워크플로우를 위한 규칙

  1. 상단에 permissions: contents: read를 설정하고, 필요한 작업에만 권한을 확장합니다. packages: write는 GHCR에 푸시하는 작업에, contents: write는 릴리스를 생성하는 작업에만 사용합니다. id-token: write 또는 attestations: write는 사용하지 않습니다. provenance 및 SBOM은 BuildKit에서 제공되며, actions/attest*(프라이빗 리포지토리에서 GitHub Enterprise 필요)가 아닙니다.

  2. GITHUB_TOKEN만 사용합니다. GHCR 로그인은 ${{ github.actor }} / ${{ secrets.GITHUB_TOKEN }}을 사용하고, gh는 GH_TOKEN: ${{ github.token }}을 사용합니다. CI에 개인 액세스 토큰을 사용하지 마십시오. (클러스터에서 프라이빗 패키지를 가져오는 것은 다른 자격 증명입니다. helm-nextjs 참조.)

  3. 액션 메이저 버전(@v7)을 고정하고 SHA 테이블을 최신 상태로 유지합니다. 템플릿은 가독성을 위해 메이저 태그를 사용합니다. 조직에서 SHA 고정을 요구하는 경우 각 @vN을 references/action-pins.md의 SHA로 바꾸고 # vN.M.P 주석을 유지하십시오. 현재 메이저 버전: checkout v7, setup-node v7, pnpm/action-setup v6, setup-qemu v4, setup-buildx v4, login v4, metadata v6, build-push v7, azure/setup-helm v5.

  4. 도구 체인: pnpm/action-setup을 actions/setup-node보다 먼저 실행합니다. action-setup은 packageManager에서 pnpm 버전을 읽고, setup-node는 .node-version을 읽고 pnpm 스토어를 캐시합니다(cache: pnpm은 PATH에 pnpm이 먼저 있어야 함). 그런 다음 pnpm install --frozen-lockfile을 실행합니다. npm ci는 절대 사용하지 마십시오.

  5. 워크플로우 및 ref별 concurrency를 설정하고, PR에서만 진행 중인 실행을 취소합니다. PR에 새 푸시가 발생하면 이전 실행이 취소됩니다. main 및 태그에서는 실행이 항상 완료됩니다. release.yaml은 해당 정확한 커밋의 이미지가 필요합니다.

  6. 비밀을 절대 echo하거나 신뢰할 수 없는 입력을 run:에 직접 삽입하지 마십시오. 값을 env:를 통해 전달하고 따옴표로 감싸십시오("${APP}"). ${{ github.event.pull_request.title }}과 같은 값은 스크립트 내부에 절대 넣지 마십시오. git에 푸시하지 않는 작업에서는 persist-credentials: false로 설정하십시오.

  7. 모든 작업에는 timeout-minutes가 설정되어야 합니다. 그렇지 않으면 중단된 Docker 빌드가 6시간 동안 실행될 수 있습니다.

  8. 이름은 소문자로 사용합니다. GHCR은 대문자 리포지토리를 거부합니다. IMAGE: ghcr.io/nuvraxis/<app>은 env에 소문자로 작성되며, 스캐폴드가 앱 이름을 소문자로 변환합니다.

pr.yaml

  1. on: pull_request에 types: [opened, synchronize, reopened, ready_for_review]를 사용하고 branches 필터를 설정하지 않습니다. 따라서 기능 브랜치에 대한 스택형 PR도 검사됩니다. 모든 작업에는 if: ${{ !github.event.pull_request.draft }}가 있으며, 준비 완료로 표시하면 실행이 트리거됩니다.

  2. 네 개의 병렬 작업: quality (biome ci --reporter=github, stylelint, turbo run typecheck test --affected, pnpm audit --audit-level high), build (turbo run build --affected), docker (하나의 플랫폼을 load: true로 빌드하고, 기능을 제거한 읽기 전용 모드로 실행한 후 /api/health에 curl 실행), helm (helm lint --strict 및 두 values 파일에 대해 kubeconform 실행). --affected는 fetch-depth: 0이 필요합니다.

  3. PR에서는 아무것도 푸시되지 않습니다. push: false, 캐시는 읽기 전용(cache-from만), 레지스트리 로그인 없음.

main.yaml

  1. on: push: branches: [main]은 이미지를 한 번 빌드하여 두 아키텍처 모두를 푸시합니다. docker/metadata-action의 태그: type=sha,format=short,prefix=sha- 및 type=raw,value=main, flavor: latest=false. latest는 릴리스용입니다.

  2. provenance: mode=max, sbom: true, cache-from/to: type=gha,scope=<app>,mode=max. Provenance 및 SBOM은 이미지 인덱스에 첨부되며, release.yaml에서 리태깅 시 함께 전달됩니다. NEXT_DEPLOYMENT_ID=${{ github.sha }}는 스큐 보호를 위한 빌드 인자입니다.

  3. main.yaml은 차트를 퍼블리시하지 않으며 PR 검사를 다시 실행하지 않습니다. 브랜치 보호는 pr.yaml을 요구하며, main은 아티팩트만 생성합니다.

release.yaml

  1. on: push: tags: ['v*.*.*'], 그런 다음 순서대로:

    1. 태그가 정확히 vMAJOR.MINOR.PATCH 형식이고 해당 커밋이 origin/main의 조상이어야 합니다. 그렇지 않으면 실패합니다.
    2. 재빌드하지 않습니다. ghcr.io/nuvraxis/<app>:sha-<short>가 존재하지 않으면 "main.yaml이 완료될 때까지 기다린 후 다시 실행" 메시지와 함께 실패합니다. 대체 빌드는 없습니다.
    3. docker buildx imagetools create --tag :vX.Y.Z --tag :latest <sha-image>: 두 아키텍처, provenance 및 SBOM을 동일한 다이제스트로 유지하는 매니페스트 수준 복사입니다.
    4. helm package --version X.Y.Z --app-version vX.Y.Z, helm push to oci://ghcr.io/nuvraxis/charts.
    5. gh release create vX.Y.Z --verify-tag --generate-notes 명령으로 차트 .tgz, image-digest.txt 및 sbom.spdx.json을 첨부합니다.
  2. 릴리스 절차: main에 병합 → main.yaml이 초록색이 될 때까지 기다림 → git tag vX.Y.Z && git push origin vX.Y.Z. main.yaml이 완료되기 전에 태깅하면 2단계에서 의도적으로 실패합니다. 이미지가 존재하면 릴리스 작업을 다시 실행하십시오. 잘못된 릴리스는 태그를 이동하는 것이 아니라 새 패치 태그로 수정합니다.

속도 향상 (필요할 때만)

  • arm64에서 QEMU는 main.yaml의 느린 부분입니다. ubuntu-24.04-arm + ubuntu-latest를 활용한 매트릭스로 대체하고, 다이제스트로 푸시한 다음 imagetools create로 병합 작업을 수행하십시오. 태그와 단일 인덱스를 유지하십시오.
  • pr.yaml을 위한 Turborepo 원격 캐시: pnpm-turborepo 참조.

검증

docker run --rm -v "$PWD:/repo" -w /repo rhysd/actionlint:latest     # 모든 워크플로우 린트
gh workflow list && gh run list --limit 5
gh run view <run-id> --log-failed

릴리스 후: docker buildx imagetools inspect ghcr.io/nuvraxis/<app>:vX.Y.Z는 두 플랫폼을 모두 보여주고, helm show chart oci://ghcr.io/nuvraxis/charts/<app> --version X.Y.Z는 appVersion: vX.Y.Z를 보여줍니다.

출처

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

Nuvraxis/nuvraxis-plugins

>- Biome 2.5 setup and rules for Nuvraxis monorepos — root biome.json with pinned $schema, VCS ignore, formatter settings, the recommended preset with a11y and the react/next domains, nursery policy, organize imports, overrides, nested per-package configs ("extends": "//"), biome check --write locally, biome ci in CI, VS Code settings, and migrating from ESLint/Prettier. Use when the repo has biome.json or biome.jsonc, @biomejs/biome in package.json, .eslintrc*/eslint.config.*/.prettierrc* to migrate, or when fixing lint and formatting errors.

Nuvraxis/nuvraxis-plugins

>- Dockerfile rules for Next.js standalone apps in a pnpm + Turborepo monorepo — multi-stage build (turbo prune → pnpm fetch/offline install → turbo build → minimal runner), pinned Node 26 Alpine by digest, checksum-verified pnpm binary, non-root uid 1001, read-only root filesystem with a writable .next/cache, HEALTHCHECK on /api/health, build args only for NEXT_PUBLIC_* values, BuildKit secrets and cache mounts, multi-arch, OCI labels and .dockerignore. Use when the repo has a Dockerfile, .dockerignore, compose file, or next.config with output "standalone", or when asked to containerise, shrink, harden or debug an image.

Nuvraxis/nuvraxis-plugins

>- Helm chart rules for Nuvraxis Next.js apps — one chart per app in charts/ (named after the app), published to oci://ghcr.io/nuvraxis/charts and synced by Argo CD; Chart.yaml version/appVersion set only by release.yaml; Deployment with startup/liveness/readiness probes on /api/health, non-root read-only security context, emptyDir for .next/cache, ConfigMap + existing Secret via envFrom, Service, Ingress with cert-manager, HPA, PDB, ServiceAccount, topology spread; no Helm hooks; helm lint --strict + kubeconform. Use when the repo has charts/, Chart.yaml, values*.yaml, templates/*.yaml with Helm syntax, or an Argo CD Application, or when asked to deploy, scale, expose or configure the app on Kubernetes.

Nuvraxis/nuvraxis-plugins

>- Production rules for Next.js 16 App Router apps at Nuvraxis — Server/Client Component boundaries, Cache Components ("use cache", cacheLife, cacheTag, updateTag), Server Actions, route handlers, env handling, instrumentation, output standalone and the /api/health route. Use when the project has "next" in package.json, an app/ or src/app/ directory, next.config.ts, proxy.ts, instrumentation.ts, or files named page.tsx, layout.tsx, route.ts, loading.tsx, error.tsx.

관련 스킬