-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.4 KB
/
pages-deployment.yaml
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
46
47
48
49
name: Deploy to Cloudflare Pages
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Deploy to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8 # Use the version of pnpm you need
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18' # Use the Node.js version your project requires
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: setup environment variables
run: |
touch .env
echo "DATABASE_URL=libsql://example.turso.io" >> .env
echo "TURSO_AUTH_TOKEN=deploy" >> .env
echo "STRIPE_SECRET_KEY=deploy" >> .env
echo "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=deploy" >> .env
echo "STRIPE_WEBHOOK_SECRET=deploy" >> .env
echo "RESEND_API_KEY=deploy" >> .env
echo "EMAIL_FROM=deploy" >> .env
- name: Install Wrangler
run: pnpm add -g wrangler
- name: Deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_PROJECT_NAME: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
run: pnpm run deploy