Skip to content

Workflow file for this run

# 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:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DATA_PROXY: ${{ secrets.DATA_PROXY }}
IMAGE_API_TOKEN: ${{ secrets.IMAGE_API_TOKEN }}
IMAGE_API: ${{ secrets.IMAGE_API }}
PUBLIC_IMAGE_DELIVERY: ${{ secrets.PUBLIC_IMAGE_DELIVERY }}
IMAGE_API_ACCOUNT_IDENTIFIER: ${{ secrets.IMAGE_API_ACCOUNT_IDENTIFIER }}
IS_CI: true
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: Run 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
BUILD:
name: Build Apps
environment: PREVIEW
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: Build
env:
IS_CI: false
run: |
pnpm build
################ PUBLISH #################
PUBLISH_WEBAPP:
name: Publish WebApp
environment: PREVIEW
runs-on: ubuntu-latest
needs: [INSTALL, BUILD, 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: Publish WebApp to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
packageManager: pnpm
workingDirectory: ./apps/web/
command: pages deploy .svelte-kit/cloudflare --project-name=cloudkit
wranglerVersion: '3'
PUBLISH_SWAGGER_UI:
name: Publish Swagger UI
environment: PREVIEW
runs-on: ubuntu-latest
needs: [INSTALL, BUILD, 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: Publish
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
packageManager: pnpm
workingDirectory: ./apps/swagger-ui/
command: pages deploy .svelte-kit/cloudflare --project-name=cloudkit-api
wranglerVersion: '3'
PUBLISH_STORYBOOK:
name: Publish Storybook
environment: PREVIEW
runs-on: ubuntu-latest
needs: [INSTALL, BUILD, 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: Publish
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
packageManager: pnpm
workingDirectory: ./apps/styleguide/
command: pages deploy storybook-static --project-name=cloudkit-styleguide
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