Skip to content

Commit

Permalink
disable backend-preview workflow in short term
Browse files Browse the repository at this point in the history
  • Loading branch information
taronaleksanian committed Jul 25, 2024
1 parent 852967e commit 29a39fe
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 193 deletions.
167 changes: 83 additions & 84 deletions .github/workflows/backend-preview.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,91 @@
name: 'Backend Preview Deployment'
# name: 'Backend Preview Deployment'

on:
workflow_dispatch:
pull_request:
branches:
- feat/preview-version-of-api
types: [closed]
push:
branches:
- feat/preview-version-of-api
paths:
- 'packages/validations/**'
- 'packages/shared-types/**'
- 'server/**'
# on:
# workflow_dispatch:
# pull_request:
# branches:
# - feat/preview-version-of-api
# types: [closed]
# push:
# branches:
# - feat/preview-version-of-api
# paths:
# - 'packages/validations/**'
# - 'packages/shared-types/**'
# - 'server/**'
# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# jobs:
# deploy:
# name: Deploy to Cloudflare Workers
# runs-on: ubuntu-latest
# timeout-minutes: 10

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

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1
# - name: Setup JS Runtime environment
# uses: ./.github/actions/setup-js-runtime

- name: Setup JS Runtime environment
uses: ./.github/actions/setup-js-runtime
# - name: Install dependencies
# uses: ./.github/actions/install-deps

- name: Install dependencies
uses: ./.github/actions/install-deps
# - name: Generate wrangler.toml
# uses: ./.github/actions/setup-wrangler-toml
# with:
# GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
# GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
# STMP_EMAIL: ${{ secrets.STMP_EMAIL }}
# STMP_PASSWORD: ${{ secrets.STMP_PASSWORD }}
# JWT_SECRET: ${{ secrets.JWT_SECRET }}
# SEND_GRID_API_KEY: ${{ secrets.SEND_GRID_API_KEY }}
# MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
# OPENWEATHER_KEY: ${{ secrets.OPENWEATHER_KEY }}
# VECTORIZE_API_KEY: ${{ secrets.VECTORIZE_API_KEY }}
# CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# PREVIEW_DB_ID: ${{ secrets.PREVIEW_DB_ID }}
# PRODUCTION_DB_ID: ${{ secrets.PRODUCTION_DB_ID }}
# PREVIEW_GOOGLE_CLIENT_ID: ${{ secrets.PREVIEW_GOOGLE_CLIENT_ID }}
# PREVIEW_GOOGLE_CLIENT_SECRET: ${{ secrets.PREVIEW_GOOGLE_CLIENT_SECRET }}
# PREVIEW_STMP_EMAIL: ${{ secrets.PREVIEW_STMP_EMAIL }}
# PREVIEW_STMP_PASSWORD: ${{ secrets.PREVIEW_STMP_PASSWORD }}
# PREVIEW_JWT_SECRET: ${{ secrets.PREVIEW_JWT_SECRET }}
# PREVIEW_SEND_GRID_API_KEY: ${{ secrets.PREVIEW_SEND_GRID_API_KEY }}
# PREVIEW_MAPBOX_ACCESS_TOKEN: ${{ secrets.PREVIEW_MAPBOX_ACCESS_TOKEN }}
# PREVIEW_OPENWEATHER_KEY: ${{ secrets.PREVIEW_OPENWEATHER_KEY }}
# PREVIEW_VECTORIZE_API_KEY: ${{ secrets.PREVIEW_VECTORIZE_API_KEY }}
# PREVIEW_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.PREVIEW_CLOUDFLARE_ACCOUNT_ID }}
# PREVIEW_OPENAI_API_KEY: ${{ secrets.PREVIEW_OPENAI_API_KEY }}

- name: Generate wrangler.toml
uses: ./.github/actions/setup-wrangler-toml
with:
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
STMP_EMAIL: ${{ secrets.STMP_EMAIL }}
STMP_PASSWORD: ${{ secrets.STMP_PASSWORD }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
SEND_GRID_API_KEY: ${{ secrets.SEND_GRID_API_KEY }}
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
OPENWEATHER_KEY: ${{ secrets.OPENWEATHER_KEY }}
VECTORIZE_API_KEY: ${{ secrets.VECTORIZE_API_KEY }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PREVIEW_DB_ID: ${{ secrets.PREVIEW_DB_ID }}
PRODUCTION_DB_ID: ${{ secrets.PRODUCTION_DB_ID }}
PREVIEW_GOOGLE_CLIENT_ID: ${{ secrets.PREVIEW_GOOGLE_CLIENT_ID }}
PREVIEW_GOOGLE_CLIENT_SECRET: ${{ secrets.PREVIEW_GOOGLE_CLIENT_SECRET }}
PREVIEW_STMP_EMAIL: ${{ secrets.PREVIEW_STMP_EMAIL }}
PREVIEW_STMP_PASSWORD: ${{ secrets.PREVIEW_STMP_PASSWORD }}
PREVIEW_JWT_SECRET: ${{ secrets.PREVIEW_JWT_SECRET }}
PREVIEW_SEND_GRID_API_KEY: ${{ secrets.PREVIEW_SEND_GRID_API_KEY }}
PREVIEW_MAPBOX_ACCESS_TOKEN: ${{ secrets.PREVIEW_MAPBOX_ACCESS_TOKEN }}
PREVIEW_OPENWEATHER_KEY: ${{ secrets.PREVIEW_OPENWEATHER_KEY }}
PREVIEW_VECTORIZE_API_KEY: ${{ secrets.PREVIEW_VECTORIZE_API_KEY }}
PREVIEW_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.PREVIEW_CLOUDFLARE_ACCOUNT_ID }}
PREVIEW_OPENAI_API_KEY: ${{ secrets.PREVIEW_OPENAI_API_KEY }}
# - name: Migrate database
# # run: cd packages/api && bun run migrate
# run: cd server && yarn run migrate:preview
# env:
# NO_D1_WARNING: true
# CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

- name: Migrate database
# run: cd packages/api && bun run migrate
run: cd server && yarn run migrate:preview
env:
NO_D1_WARNING: true
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

- name: Deploy
uses: cloudflare/[email protected]
with:
wranglerVersion: '3.15.0'
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# workingDirectory: packages/api
workingDirectory: server
command: yarn run deploy:preview
# packageManager: bun
packageManager: yarn
secrets: |
APP_URL
JWT_VERIFICATION_KEY
CI
env:
APP_URL: ${{ secrets.VITE_PUBLIC_APP_URL }}
JWT_VERIFICATION_KEY: ${{ secrets.JWT_SECRET }}
CI: true
NO_D1_WARNING: true
# - name: Deploy
# uses: cloudflare/[email protected]
# with:
# wranglerVersion: '3.15.0'
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# # workingDirectory: packages/api
# workingDirectory: server
# command: yarn run deploy:preview
# # packageManager: bun
# packageManager: yarn
# secrets: |
# APP_URL
# JWT_VERIFICATION_KEY
# CI
# env:
# APP_URL: ${{ secrets.VITE_PUBLIC_APP_URL }}
# JWT_VERIFICATION_KEY: ${{ secrets.JWT_SECRET }}
# CI: true
# NO_D1_WARNING: true
Loading

0 comments on commit 29a39fe

Please sign in to comment.