Skip to content

Commit

Permalink
Add Cloudflare deploy and scripts (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
spicy-wolf committed Jan 2, 2024
1 parent a3e7feb commit 02c3fb4
Show file tree
Hide file tree
Showing 3 changed files with 1,404 additions and 74 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/cloudflare.deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to Cloudflare Pages

on:
push:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
- name: Checkout 🛒
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install and Build 🔧
run: |
npm ci
npm run build
publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy 🚀
uses: cloudflare/pages-action@v1.5
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: storychoices
directory: dist
branch: main # main branch is the production branch on Cloudflare Pages
Loading

0 comments on commit 02c3fb4

Please sign in to comment.