Daily deploy to CF Pages #324
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- 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 |