Skip to content

feat: add cloudflare prod deployment configurations #24

feat: add cloudflare prod deployment configurations

feat: add cloudflare prod deployment configurations #24

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 }}
REDIS_TOKEN: ${{ secrets.REDIS_TOKEN }}
REDIS_URL: ${{ secrets.REDIS_URL }}
CLOUDFLARE_IMAGE_API_TOKEN: ${{ secrets.CLOUDFLARE_IMAGE_API_TOKEN }}
CLOUDFLARE_IMAGE_API: ${{ secrets.CLOUDFLARE_IMAGE_API }}
PUBLIC_CLOUDFLARE_IMAGE_DELIVERY: ${{ secrets.PUBLIC_CLOUDFLARE_IMAGE_DELIVERY }}
IS_CI: true
jobs:
INSTALL:
name: Install Dependencies
environment: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8.9.2
- uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'pnpm'
- name: Install
run: |
pnpm install
LINT:
name: ESLint & SvelteKit Check
environment: CI
runs-on: ubuntu-latest
needs: INSTALL
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8.9.2
- uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'pnpm'
- name: Install
run: |
pnpm install
- name: Prisma Generate
run: |
pnpm prisma:gen:ci
- name: Lint
run: |
pnpm lint
- name: Check
run: |
pnpm check
UNIT_TEST:
name: Run Unit Tests
environment: CI
runs-on: ubuntu-latest
needs: INSTALL
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8.9.2
- uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'pnpm'
- name: Install
run: |
pnpm install
- name: Prisma Generate
run: |
pnpm prisma:gen:dev
- name: Unit Test
run: |
pnpm test:unit
E2E_TEST:
name: Run E2E Tests
environment: CI
needs: [INSTALL]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Services
run: |
sudo docker-compose up -d
- uses: pnpm/action-setup@v2
with:
version: 8.9.2
- uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'pnpm'
- name: Install
run: |
pnpm install
- name: Prisma Generate
run: |
pnpm prisma:gen:ci
- name: Prisma Push
run: |
pnpm prisma:push:dev
- name: Install Playwright Browsers
run: |
pnpm playwright install-deps chromium
- name: Seed Database
run: |
pnpm psql:seed
- name: Integration Test
run: |
pnpm run test:integration:ci
PUBLISH:
name: Publish to Feature Branch
environment: PREVIEW
runs-on: ubuntu-latest
needs: INSTALL
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8.9.2
- uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'pnpm'
- name: Install
run: |
pnpm install
- name: Build
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
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
# workingDirectory: my-site
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`
wranglerVersion: '3'