Merge pull request #1134 from andrew-bierman/fixing #4
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 Deployment' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
- andrew_testing | |
paths: | |
- 'packages/api/**' | |
- '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: Install dependencies | |
uses: ./.github/actions/install-deps | |
- name: Migrate database | |
# run: cd packages/api && bun run migrate | |
run: cd server && yarn run migrate:prod | |
env: | |
NO_D1_WARNING: true | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
- name: Deploy | |
uses: cloudflare/[email protected] | |
with: | |
wranglerVersion: '3.15.0' | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
# workingDirectory: packages/api | |
workingDirectory: server | |
command: yarn run deploy:prod | |
# packageManager: bun | |
packageManager: yarn | |
secrets: | | |
CI | |
GOOGLE_CLIENT_ID | |
GOOGLE_CLIENT_SECRET | |
STMP_EMAIL | |
STMP_PASSWORD | |
JWT_SECRET | |
SEND_GRID_API_KEY | |
MAPBOX_ACCESS_TOKEN | |
OSM_URI | |
WEATHER_URL | |
WEATHER_WEEK_URL | |
OPENWEATHER_KEY | |
VECTORIZE_API_KEY | |
CLOUDFLARE_ACCOUNT_ID | |
VITE_PUBLIC_APP_URL | |
env: | |
APP_URL: ${{ secrets.VITE_PUBLIC_APP_URL }} | |
JWT_VERIFICATION_KEY: ${{ secrets.JWT_SECRET }} | |
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 }} | |
OSM_URI: ${{ secrets.OSM_URI }} | |
WEATHER_URL: ${{ secrets.WEATHER_URL }} | |
WEATHER_WEEK_URL: ${{ secrets.WEATHER_WEEK_URL }} | |
OPENWEATHER_KEY: ${{ secrets.OPENWEATHER_KEY }} | |
VECTORIZE_API_KEY: ${{ secrets.VECTORIZE_API_KEY }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
CI: true | |
NO_D1_WARNING: true |