Deploy to Cloudflare Pages #6
This file contains hidden or 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: Deploy to Cloudflare Pages | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| JEKYLL_ENV: production | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2.3' | |
| bundler-cache: true | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 'latest' | |
| - name: Install JS deps (bun) | |
| run: bun install --frozen-lockfile | |
| - name: Install Ruby gems | |
| run: | | |
| bundle config set path 'vendor/bundle' | |
| bundle install --jobs 4 --retry 3 | |
| - name: Build site | |
| run: bun run build | |
| - name: Deploy with Wrangler | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| # Use the project name from wrangler.toml | |
| command: pages deploy _site --project-name perma-web --branch main | |