name: Deploy to Cloudflare Pages on: push: branches: [main] workflow_dispatch: permissions: contents: read jobs: deploy: runs-on: ubuntu-latest steps: - name: Check out repository uses: actions/checkout@v4 - name: Set up Node uses: actions/setup-node@v4 with: node-version: '22' - name: Install Wrangler run: npm install --no-save wrangler@^4 - name: Stage markdown copy run: cp MODELS.md site/MODELS.md - name: Ensure Pages project exists env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} # Idempotent: creates the project on first run, no-ops afterwards. run: npx wrangler pages project create opencodogoevals || echo "project already exists" - name: Deploy to Cloudflare Pages env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} run: | npx wrangler pages deploy site \ --project-name opencodogoevals \ --branch main \ --commit-hash "${{ gitea.sha }}" \ --commit-message "${{ gitea.event.head_commit.message }}"