Skip to content

Add Cloudflare deploy and scripts (#145) #5

Add Cloudflare deploy and scripts (#145)

Add Cloudflare deploy and scripts (#145) #5

name: Publish to Cloudflare Pages
on:
push:
branches: [ "master" ]
jobs:
build:

Check failure on line 8 in .github/workflows/cloudflare.deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/cloudflare.deploy.yml

Invalid workflow file

You have an error in your yaml syntax on line 8
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