Skip to content

Fetch, Build, and Deploy to Cloudflare Pages #472

Fetch, Build, and Deploy to Cloudflare Pages

Fetch, Build, and Deploy to Cloudflare Pages #472

name: Fetch, Build, and Deploy to Cloudflare Pages
on:
workflow_dispatch: # Allow manual triggering
schedule:
- cron: "0 0 * * *" # Runs daily at midnight UTC
jobs:
fetch-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
- name: Install dependencies
run: npm install
- name: Fetch repository data
run: node utils/fetchData/fetchRepoData.cjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build the project
run: npm run build
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy ./dist --project-name=cloudsectools --branch=main