36 lines
1.3 KiB
YAML
36 lines
1.3 KiB
YAML
name: Remote development preview source sync
|
|
on:
|
|
push:
|
|
branches: ['**']
|
|
paths:
|
|
- 'apps/waterfall-wiki/**'
|
|
- 'packages/brand/**'
|
|
- 'pnpm-workspace.yaml'
|
|
- 'scripts/preview/**'
|
|
- '.gitea/workflows/preview.yml'
|
|
concurrency:
|
|
group: development-preview
|
|
cancel-in-progress: false
|
|
jobs:
|
|
sync-source:
|
|
# One preview slot follows one branch. Setup changes use an explicit refresh.
|
|
if: gitea.ref == format('refs/heads/{0}', vars.PREVIEW_BRANCH || 'dev')
|
|
runs-on: ces-control
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Initialize once, otherwise synchronize files only
|
|
env:
|
|
SOURCE_SHA: ${{ gitea.sha }}
|
|
SOURCE_BRANCH: ${{ gitea.ref_name }}
|
|
run: |
|
|
if [ ! -f /opt/prompt-preview/ready ]; then
|
|
bash scripts/preview/init.sh "$PWD" waterfall-wiki-tests:6654a1456bdcef77d83ca84373dc36188e15bd12
|
|
fi
|
|
bash scripts/preview/sync.sh "$PWD" "$SOURCE_SHA" "$SOURCE_BRANCH"
|
|
- name: Import approved PostgreSQL snapshot into dev
|
|
if: gitea.ref == 'refs/heads/dev' && startsWith(gitea.event.head_commit.message, 'Import approved PostgreSQL snapshot into dev')
|
|
run: bash scripts/preview/import-production-snapshot.sh
|