V2 (#26) #380
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
# This is a basic workflow to automatically build a Svelte app and deploy it to GitHub Pages | |
name: Merge to Master | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: '0 5 * * *' | |
env: | |
DIRECT_DATABASE_URL: ${{secrets.DIRECT_DATABASE_URL}} | |
DATABASE_URL: ${{secrets.DATABASE_URL}} | |
PUBLIC_IMAGE_API_URL: ${{secrets.PUBLIC_IMAGE_API_URL}} | |
IMAGE_API_TOKEN: ${{secrets.IMAGE_API_TOKEN}} | |
IMAGE_API_ACCOUNT_IDENTIFIER: ${{secrets.IMAGE_API_ACCOUNT_IDENTIFIER}} | |
IS_CI: ${{secrets.IS_CI}} | |
ENVIRONMENT: ${{secrets.ENVIRONMENT}} | |
CLOUDFLARE_ACCOUNT_ID: ${{secrets.CLOUDFLARE_ACCOUNT_ID}} | |
CLOUDFLARE_API_TOKEN: ${{secrets.CLOUDFLARE_API_TOKEN}} | |
jobs: | |
INSTALL: | |
name: Install Dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9.1.1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- uses: actions/cache@v3 | |
id: cache-pnpm | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', './prisma/dev.schema.prisma', './prisma/prod.schema.prisma') }} | |
- name: Install | |
if: steps.cache-pnpm.outputs.cache-hit != 'true' | |
run: | | |
pnpm i --frozen-lockfile | |
pnpm prisma:gen:ci | |
PUBLISH: | |
name: Publish to Production | |
environment: PRODUCTION | |
runs-on: ubuntu-latest | |
needs: INSTALL | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9.1.1 | |
- uses: actions/cache@v3 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', './prisma/dev.schema.prisma', './prisma/prod.schema.prisma') }} | |
- name: Build | |
env: | |
IS_CI: false | |
run: | | |
pnpm build:prod | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: cloudkit | |
directory: ./.svelte-kit/cloudflare | |
# Optional: Enable this if you want to have GitHub Deployments triggered | |
# Optional: Switch what branch you are publishing to. | |
# By default this will be the branch which triggered this workflow | |
# branch: master | |
# 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' |