Merge pull request #1394 from andrew-bierman/validation_order #500
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Backend Preview Deployment' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- development | |
paths: | |
- '.github/workflows/backend-preview.yml' | |
- 'packages/validations/**' | |
- 'server/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
name: Deploy to Cloudflare Workers | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Setup JS Runtime environment | |
uses: ./.github/actions/setup-js-runtime | |
- name: Generate wrangler.toml and .env | |
uses: ./.github/actions/setup-wrangler-toml-and-dotenv | |
with: | |
environment: preview | |
APP_URL: ${{ secrets.PREVIEW_APP_URL }} | |
AWS_SIGN_ALGORITHM: ${{ secrets.PREVIEW_AWS_SIGN_ALGORITHM }} | |
BUCKET_ENDPOINT: ${{ secrets.PREVIEW_BUCKET_ENDPOINT }} | |
BUCKET_NAME: ${{ secrets.PREVIEW_BUCKET_NAME }} | |
BUCKET_REGION: ${{ secrets.PREVIEW_BUCKET_REGION }} | |
BUCKET_SERVICE: ${{ secrets.PREVIEW_BUCKET_SERVICE }} | |
BUCKET_SESSION_TOKEN: ${{ secrets.PREVIEW_BUCKET_SESSION_TOKEN }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.PREVIEW_CLOUDFLARE_ACCOUNT_ID }} | |
DB_ID: ${{ secrets.PREVIEW_DB_ID }} | |
MIGRATIONS_PATH: migrations-preview | |
GOOGLE_CLIENT_ID: ${{ secrets.PREVIEW_GOOGLE_CLIENT_ID }} | |
STMP_EMAIL: ${{ secrets.PREVIEW_STMP_EMAIL }} | |
VECTOR_INDEX_NAME: ${{ secrets.PREVIEW_VECTOR_INDEX }} | |
- name: Migrate database | |
uses: ./.github/actions/migrate-d1-database | |
with: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.PREVIEW_CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_ENVIRONMENT: preview | |
- name: Deploy | |
uses: ./.github/actions/deploy-cloudflare-worker | |
with: | |
BUCKET_ACCESS_KEY_ID: ${{ secrets.PREVIEW_BUCKET_ACCESS_KEY_ID }} | |
BUCKET_SECRET_KEY: ${{ secrets.PREVIEW_BUCKET_SECRET_KEY }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.PREVIEW_CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_ENVIRONMENT: preview | |
GOOGLE_CLIENT_SECRET: ${{ secrets.PREVIEW_GOOGLE_CLIENT_SECRET }} | |
JWT_SECRET: ${{ secrets.PREVIEW_JWT_SECRET }} | |
JWT_VERIFICATION_KEY: ${{ secrets.PREVIEW_JWT_SECRET }} | |
MAPBOX_ACCESS_TOKEN: ${{ secrets.PREVIEW_MAPBOX_ACCESS_TOKEN }} | |
OPENAI_API_KEY: ${{ secrets.PREVIEW_OPENAI_API_KEY }} | |
OPENWEATHER_KEY: ${{ secrets.PREVIEW_OPENWEATHER_KEY }} | |
REFRESH_TOKEN_SECRET: ${{ secrets.PREVIEW_REFRESH_TOKEN_SECRET }} | |
SEND_GRID_API_KEY: ${{ secrets.PREVIEW_SEND_GRID_API_KEY }} | |
STMP_PASSWORD: ${{ secrets.PREVIEW_STMP_PASSWORD }} | |
VECTORIZE_API_KEY: ${{ secrets.PREVIEW_VECTORIZE_API_KEY }} | |
WORKERS_AI_API_KEY: ${{ secrets.PREVIEW_WORKERS_AI_API_KEY }} | |
X_AMZ_SECURITY_TOKEN: ${{ secrets.PREVIEW_X_AMZ_SECURITY_TOKEN }} |