Skip to content

ci: Deploy to Cloudflare using a Github Action #23

ci: Deploy to Cloudflare using a Github Action

ci: Deploy to Cloudflare using a Github Action #23

Workflow file for this run

name: Deploy to Cloudflare Pages
on:
push:
branches:
- master
workflow_dispatch:
inputs:
environment:
description: "Choose an environment to deploy to: <dev|staging|prod>"
required: true
default: "dev"
pull_request:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v4
- name: Setup yarn
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: "24"
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy out --project-name=rescript-lang-org
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}