add wrangler toml #7
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: 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: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
deployments: write | |
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 | |
env: | |
PUBLIC_WEB_HOSTNAME: ${{ vars.PUBLIC_WEB_HOSTNAME }} | |
PUBLIC_GITHUB_CLIENT_ID: ${{ vars.PUBLIC_GITHUB_CLIENT_ID }} | |
run: | | |
pnpm run proto | |
pnpm astro build | |
pnpm wrangler d1 migrations apply warpdive-db --remote --env production | |
working-directory: ${{ env.BUILD_PATH }} | |
- name: Publish | |
uses: cloudflare/pages-action@1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }} | |
directory: ${{ env.BUILD_PATH }}/dist | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} |