Skip to content

Commit

Permalink
ci: add cloudflare pages
Browse files Browse the repository at this point in the history
  • Loading branch information
maehr committed Nov 7, 2023
1 parent 909c014 commit 658939c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/sveltekitci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -42,6 +45,15 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Setup jampack cache
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: actions/cache@v3
with:
path: '.jampack'
key: jampack-${{ github.run_id }}
restore-keys: |
jampack
- name: Install dependencies
run: pnpm install

Expand All @@ -58,4 +70,23 @@ jobs:
run: pnpm run build

- name: Postbuild
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
run: pnpm run postbuild

- name: Publish to Cloudflare Pages
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: stadtgeschichtebasel-ch
directory: build
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# Optional: Switch what branch you are publishing to.
# By default this will be the branch which triggered this workflow
branch: main
# Optional: Change the working directory
# workingDirectory: my-site
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`
# wranglerVersion: '3'

0 comments on commit 658939c

Please sign in to comment.