Daily deploy to CF Pages #651
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 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 | |
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 | |
command: --version | |
postCommands: npx wrangler pages deploy --branch $CF_BRANCH --project-name=$cloudflare_website build/ | tee -a $GITHUB_STEP_SUMMARY |