Workflow file for this run
This file contains 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: Pull Request | |
on: pull_request | |
concurrency: | |
group: ${{ github.head_ref }} | |
cancel-in-progress: true | |
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.12.1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '22.9.0' | |
- uses: actions/cache@v3 | |
id: cache-pnpm | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }} | |
- name: Install | |
if: steps.cache-pnpm.outputs.cache-hit != 'true' | |
run: | | |
pnpm i --frozen-lockfile | |
pnpm sync | |
LINT: | |
name: Lint | |
runs-on: ubuntu-latest | |
needs: INSTALL | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9.12.1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '22.9.0' | |
- uses: actions/cache@v3 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }} | |
- name: Install Module Packages | |
run: | | |
pnpm i --frozen-lockfile | |
pnpm sync | |
- name: Lint | |
run: | | |
pnpm lint | |
VERIFY: | |
name: Verify | |
runs-on: ubuntu-latest | |
needs: INSTALL | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9.12.1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '22.9.0' | |
- uses: actions/cache@v3 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }} | |
- name: Install Module Packages | |
run: | | |
pnpm i --frozen-lockfile | |
pnpm sync | |
- name: Check | |
run: | | |
pnpm check | |
UNIT_TEST: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
needs: INSTALL | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9.12.1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '22.9.0' | |
- uses: actions/cache@v3 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }} | |
- name: Install Module Packages | |
run: | | |
pnpm i --frozen-lockfile | |
pnpm sync | |
- name: Unit Test | |
run: | | |
pnpm test | |
################ PUBLISH ################# | |
PUBLISH_WEBAPP: | |
name: Publish WebApp | |
environment: PREVIEW | |
runs-on: ubuntu-latest | |
needs: [INSTALL, LINT, VERIFY, UNIT_TEST] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9.12.1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '22.9.0' | |
- uses: actions/cache@v3 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }} | |
- name: Install Module Packages | |
run: | | |
pnpm i --frozen-lockfile | |
pnpm sync | |
- name: Build | |
env: | |
IS_CI: false | |
run: | | |
pnpm turbo @cloudkit/web#build | |
- name: Publish | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: cloudkit | |
workingDirectory: ./apps/web/ | |
directory: ./.svelte-kit/cloudflare | |
# 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: ${{ github.head_ref }} | |
# Optional: Change the working directory | |
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta` | |
wranglerVersion: '3' | |
PUBLISH_STORYBOOK: | |
name: Publish Storybook | |
environment: PREVIEW | |
runs-on: ubuntu-latest | |
needs: [INSTALL, LINT, VERIFY, UNIT_TEST] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9.12.1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '22.9.0' | |
- uses: actions/cache@v3 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }} | |
- name: Install Module Packages | |
run: | | |
pnpm i --frozen-lockfile | |
pnpm sync | |
- name: Build | |
env: | |
IS_CI: false | |
run: | | |
pnpm turbo run @cloudkit/styleguide#build | |
- name: Publish | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: cloudkit-styleguide | |
workingDirectory: ./apps/styleguide/ | |
directory: ./storybook-static | |
# 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: ${{ github.head_ref }} | |
# Optional: Change the working directory | |
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta` | |
wranglerVersion: '3' | |
PUBLISH_SWAGGER: | |
name: Publish Swagger UI | |
environment: PREVIEW | |
runs-on: ubuntu-latest | |
needs: [INSTALL, LINT, VERIFY, UNIT_TEST] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9.12.1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '22.9.0' | |
- uses: actions/cache@v3 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }} | |
- name: Install Module Packages | |
run: | | |
pnpm i --frozen-lockfile | |
pnpm sync | |
- name: Build | |
env: | |
IS_CI: false | |
run: | | |
pnpm turbo run @cloudkit/swagger-ui#build | |
- name: Publish | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: cloudkit-api | |
workingDirectory: ./apps/swagger-ui/ | |
directory: ./.svelte-kit/cloudflare | |
# 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: ${{ github.head_ref }} | |
# Optional: Change the working directory | |
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta` | |
wranglerVersion: '3' | |
# Disable until I can figure out a way to deal with the flaky tests | |
# E2E_TEST: | |
# name: Run E2E Tests | |
# needs: [INSTALL] | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Setup FFmpeg | |
# uses: AnimMouse/setup-ffmpeg@v1 | |
# - uses: actions/checkout@v4 | |
# - name: Set up Services | |
# run: | | |
# sudo docker-compose up -d | |
# - uses: pnpm/action-setup@v3 | |
# with: | |
# version: 9.12.1 | |
# - uses: actions/setup-node@v3 | |
# with: | |
# node-version: '22.9.0' | |
# cache: 'pnpm' | |
# - uses: actions/cache@v3 | |
# with: | |
# path: ./node_modules | |
# key: ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc) }} | |
# - name: Prisma Generate | |
# run: | | |
# pnpm prisma:gen:dev | |
# - name: Prisma Push | |
# run: | | |
# pnpm prisma:push:dev | |
# - name: Install Playwright Browsers | |
# run: | | |
# pnpm exec playwright install | |
# pnpm playwright install-deps chromium | |
# - name: e2e Test | |
# run: | | |
# pnpm run test:e2e:ci | |
# - uses: actions/upload-artifact@v4 | |
# if: ${{ !cancelled() }} | |
# with: | |
# name: playwright-report | |
# path: test-results/ | |
# retention-days: 5 | |