-
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.46 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
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 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLIC_GITHUB_CLIENT_ID: ${{ vars.PUBLIC_GITHUB_CLIENT_ID }}
PUBLIC_WEB_HOSTNAME: ${{ vars.PUBLIC_WEB_HOSTNAME }}
run: |
pnpm run proto
pnpm astro build
pnpm wrangler d1 migrations apply warpdive-db --remote --env production
pnpm wrangler pages deploy ${{ env.BUILD_PATH }}/dist --project-name ${{ env.CLOUDFLARE_PROJECT_NAME}}