diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000000000..426012f78815060 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,42 @@ +on: [push, workflow_dispatch] + +jobs: + publish: + runs-on: ubuntu-22.04 + permissions: + contents: read + name: Publish to Cloudflare Pages + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.x + cache: npm + - run: npm ci + - uses: actions/cache/restore@v4 + with: + path: | + node_modules/.astro/_astro + node_modules/.astro/assets + key: static + - run: npx astro build + env: + NODE_OPTIONS: --max-old-space-size=4096 + - run: npx wrangler pages deploy --project-name cloudflare-docs dist + env: + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + - uses: actions/cache/save@v4 + with: + path: | + node_modules/.astro/_astro + node_modules/.astro/assets + key: static + + keepalive: + if: github.event_name == 'schedule' + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - uses: liskin/gh-workflow-keepalive@v1