Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions .github/workflows/sync-tenant-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ on:
branches:
- staging
- prod
pull_request:
branches:
- main
- staging
- prod
types:
- opened
- synchronize
- reopened
workflow_dispatch:
inputs:
target_environment:
Expand All @@ -21,7 +30,10 @@ jobs:
sync-to-staging:
name: Dry Run - Analyze tenantSchema Sync to Staging
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/staging' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_environment == 'staging')
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/staging') ||
(github.event_name == 'pull_request' && (github.base_ref == 'staging' || github.base_ref == 'main')) ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.target_environment == 'staging')
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -31,6 +43,7 @@ jobs:
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: booking-app/package-lock.json

- name: Install dependencies
working-directory: ./booking-app
Expand Down Expand Up @@ -74,13 +87,18 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: tenant-schema-dry-run-staging
path: booking-app/dry-run-staging-*.{txt,md}
path: |
booking-app/dry-run-staging-output.txt
booking-app/dry-run-staging-report.md
retention-days: 30

sync-to-production:
name: Dry Run - Analyze tenantSchema Sync to Production
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/prod' || (github.event_name == 'workflow_dispatch' && github.event.inputs.target_environment == 'production')
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/prod') ||
(github.event_name == 'pull_request' && (github.base_ref == 'prod' || github.base_ref == 'main')) ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.target_environment == 'production')
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -90,6 +108,7 @@ jobs:
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: booking-app/package-lock.json

- name: Install dependencies
working-directory: ./booking-app
Expand Down Expand Up @@ -133,6 +152,8 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: tenant-schema-dry-run-production
path: booking-app/dry-run-production-*.{txt,md}
path: |
booking-app/dry-run-production-output.txt
booking-app/dry-run-production-report.md
retention-days: 30

Loading