52 lines
1.9 KiB
YAML
52 lines
1.9 KiB
YAML
name: studio CI and deployment
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'apps/studio/**'
|
|
- 'scripts/deploy-studio.sh'
|
|
- 'scripts/verify-studio-production.sh'
|
|
- 'scripts/verify-studio-library.mjs'
|
|
- 'scripts/verify-studio-visual.cjs'
|
|
- '.gitea/workflows/studio.yml'
|
|
- 'scripts/*studio*'
|
|
- 'content/studio-examples/**'
|
|
- 'content/studio-tools/layouts-api.md'
|
|
- 'pnpm-workspace.yaml'
|
|
|
|
jobs:
|
|
verify-and-deploy:
|
|
if: gitea.ref == 'refs/heads/main' && gitea.event_name == 'push'
|
|
runs-on: ces-control
|
|
timeout-minutes: 45
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Check shared content and documentation contracts
|
|
run: |
|
|
node scripts/check-studio-contracts.mjs
|
|
node --check scripts/export-studio-series.cjs
|
|
node --check scripts/save-studio-series.mjs
|
|
bash -n scripts/publish-studio-guide.sh scripts/deliver-studio-series.sh
|
|
- name: Build and verify studio
|
|
run: docker build -f apps/studio/Dockerfile -t "prompt-studio:${{ gitea.sha }}" .
|
|
- name: Release studio
|
|
if: gitea.ref == 'refs/heads/main' && gitea.event_name == 'push'
|
|
run: bash scripts/deploy-studio.sh "${{ gitea.sha }}"
|
|
- name: Verify the deployed Studio API and native pages
|
|
if: gitea.ref == 'refs/heads/main' && gitea.event_name == 'push'
|
|
run: bash scripts/verify-studio-production.sh
|
|
- name: Save server acceptance evidence
|
|
id: acceptance_evidence
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: studio-production-acceptance
|
|
path: artifacts/studio-acceptance/
|
|
if-no-files-found: ignore
|
|
retention-days: 7
|
|
- name: Remove temporary acceptance output after upload
|
|
if: always() && steps.acceptance_evidence.outcome == 'success'
|
|
run: rm -rf artifacts/studio-acceptance
|