Skip to content

setup db

setup db #61

Workflow file for this run

name: build
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
BUILD_PATH: '.' # default value when not using subfolders
jobs:
build:
name: Build & Deploy
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install asdf & tools
uses: asdf-vm/actions/install@v3
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: ${{ env.BUILD_PATH }}
- name: Build with Astro
working-directory: ${{ env.BUILD_PATH }}
env:
PUBLIC_GITHUB_CLIENT_ID: ${{ vars.PUBLIC_GITHUB_CLIENT_ID }}
PUBLIC_WEB_HOSTNAME: ${{ vars.PUBLIC_WEB_HOSTNAME }}
run: |
pnpm run proto
pnpm astro build
- name: Deploy to Cloudflare
working-directory: ${{ env.BUILD_PATH }}
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_PROJECT_NAME: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
run: |
pnpm wrangler d1 migrations apply warpdive-db --remote --env production
pnpm wrangler pages deploy ${{ env.BUILD_PATH }}/dist --project-name ${{ env.CLOUDFLARE_PROJECT_NAME}}