Skip to content

Deploy to Cloudflare #3

Deploy to Cloudflare

Deploy to Cloudflare #3

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
build:
name: "Build and Deploy"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20.10.0
cache: "yarn"
- run: yarn install --frozen-lockfile
- uses: actions/cache/restore@v4
id: cache
with:
path: |
.cache
img
key: 11ty-${{ runner.os }}-${{ github.run_id }}
restore-keys: |
11ty-${{ runner.os }}
${{ runner.os }}-11ty
- name: Build 11ty site
run: yarn build
env:
TINA_CLIENT_ID: ${{ secrets.TINA_CLIENT_ID }}
TINA_SEARCH_TOKEN: ${{ secrets.TINA_SEARCH_TOKEN }}
TINA_TOKEN: ${{ secrets.TINA_TOKEN }}
- uses: actions/cache/save@v4
with:
path: |
.cache
img
key: 11ty-${{ runner.os }}-${{ github.run_id }}
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 8dfec48c278d5a97c93de33e072261bd
projectName: jonas-brusman-se
directory: dist
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}