Skip to content

Daily deploy to CF Pages #216

Daily deploy to CF Pages

Daily deploy to CF Pages #216

name: Daily deploy to CF Pages
on:
workflow_dispatch:
# Deploy once every day
schedule:
- cron: "0 0 * * *"
jobs:
deploy-cloudflare-pages:
name: Daily deploy to CF Pages
runs-on: ubuntu-latest
env:
CF_BRANCH: master
cloudflare_website: balenacloud-docs
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
node-version: 18
cache: "npm"
- name: Build docs
run: npm run deploy-docs --if-present
- name: Deploy to Cloudflare Pages
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
wranglerVersion: '3.5.1' # latest - https://www.npmjs.com/package/wrangler
preCommands: wrangler --version
command: pages publish --branch $CF_BRANCH --project-name=$cloudflare_website build/ | tee -a $GITHUB_STEP_SUMMARY