Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lyc8503 authored Nov 16, 2023
1 parent 83cd450 commit 512c063
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ on:
branches: ['main']

jobs:
build-page:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Terraform
uses: hashicorp/setup-terraform@v1

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
Expand All @@ -18,27 +22,24 @@ jobs:
- name: Install packages
run: |
npm install
- name: Build Page
run: |
npx @cloudflare/next-on-pages
build-worker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'

- name: Install packages
run: |
cd worker
npm install
- name: Build worker
run: |
cd worker
npx wrangler deploy src/index.ts --outdir dist --dry-run
- name: Build page
run: |
npx @cloudflare/next-on-pages
- name: Deploy using Terraform
run: |
terraform init
terraform apply
# Currently Terraform Cloudflare provider doesn't support direct upload, use wrangler to upload.
- name: Upload pages
run: |
npx wrangler pages deploy .vercel/output/static --project-name uptimeflare

0 comments on commit 512c063

Please sign in to comment.