Skip to content

Link Sevalla homepage in app hosting comparison #1997

Link Sevalla homepage in app hosting comparison

Link Sevalla homepage in app hosting comparison #1997

Workflow file for this run

name: Prisma deploy
on:
push:
branches: ["**"]
paths-ignore:
- "COMPOSER.md"
- "COMPOSER_FINDINGS.md"
workflow_dispatch:
permissions:
contents: read
id-token: write
concurrency:
group: prisma-deploy-${{ github.ref }}
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 45
environment:
name: ${{ github.ref_name == github.event.repository.default_branch && 'prisma-production' || format('prisma-preview/{0}', github.ref_name) }}
url: ${{ fromJSON(steps.deploy.outputs.urls || '{}').gateway }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
cache: pnpm
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.4.3"
- name: Validate production integrations and optional CDN purge settings
env:
WEB_REQUIRE_INTEGRATIONS: ${{ github.ref_name == github.event.repository.default_branch && '1' || '0' }}
COMPOSER_INTEGRATIONS: ${{ vars.COMPOSER_INTEGRATIONS }}
NEXT_PUBLIC_POSTHOG_KEY: ${{ secrets.NEXT_PUBLIC_POSTHOG_KEY || vars.NEXT_PUBLIC_POSTHOG_KEY }}
WEB_PUBLIC_ORIGIN: ${{ vars.WEB_PUBLIC_ORIGIN }}
CLOUDFLARE_ZONE_ID: ${{ vars.CLOUDFLARE_ZONE_ID }}
WEB_CLOUDFLARE_HOSTS: ${{ vars.WEB_CLOUDFLARE_HOSTS }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: node composer/deployment.ts
- name: Prepare the internal proxy credential
run: |
node --input-type=module <<'JS'
import { randomBytes } from "node:crypto";
import { appendFileSync } from "node:fs";
const key = randomBytes(32).toString("hex");
console.log(`::add-mask::${key}`);
appendFileSync(process.env.GITHUB_ENV, `WEB_PROXY_KEY=${key}\n`);
JS
- name: Build and deploy all web services
id: deploy
uses: prisma/cloud-deploy-action@v1
env:
COMPOSER_INTEGRATIONS: ${{ vars.COMPOSER_INTEGRATIONS }}
NEXT_PUBLIC_POSTHOG_KEY: ${{ secrets.NEXT_PUBLIC_POSTHOG_KEY || vars.NEXT_PUBLIC_POSTHOG_KEY }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
WEB_RETAIN_ASSETS: "1"
with:
module: module.ts
install-command: pnpm install --frozen-lockfile
build-command: pnpm composer:build
- name: Verify the deployed gateway and websites
if: steps.deploy.outputs.outcome == 'succeeded'
env:
WEB_REQUIRE_INTEGRATIONS: ${{ github.ref_name == github.event.repository.default_branch && '1' || '0' }}
COMPOSER_INTEGRATIONS: ${{ vars.COMPOSER_INTEGRATIONS }}
NEXT_PUBLIC_POSTHOG_KEY: ${{ secrets.NEXT_PUBLIC_POSTHOG_KEY || vars.NEXT_PUBLIC_POSTHOG_KEY }}
GATEWAY_URL: ${{ fromJSON(steps.deploy.outputs.urls).gateway }}
run: |
test -n "$GATEWAY_URL"
pnpm composer:smoke "$GATEWAY_URL"
- name: Purge configured production hostnames after gateway verification
if: steps.deploy.outputs.outcome == 'succeeded' && github.ref_name == github.event.repository.default_branch
env:
CLOUDFLARE_ZONE_ID: ${{ vars.CLOUDFLARE_ZONE_ID }}
WEB_CLOUDFLARE_HOSTS: ${{ vars.WEB_CLOUDFLARE_HOSTS }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: node composer/deployment.ts purge
- name: Verify the production custom hostname when configured
if: steps.deploy.outputs.outcome == 'succeeded' && github.ref_name == github.event.repository.default_branch && vars.WEB_PUBLIC_ORIGIN != ''
env:
WEB_REQUIRE_INDEXABLE: "1"
WEB_EXPECTED_RELEASE: ${{ github.sha }}
WEB_REQUIRE_INTEGRATIONS: "1"
COMPOSER_INTEGRATIONS: ${{ vars.COMPOSER_INTEGRATIONS }}
NEXT_PUBLIC_POSTHOG_KEY: ${{ secrets.NEXT_PUBLIC_POSTHOG_KEY || vars.NEXT_PUBLIC_POSTHOG_KEY }}
WEB_PUBLIC_ORIGIN: ${{ vars.WEB_PUBLIC_ORIGIN }}
run: pnpm composer:smoke "$WEB_PUBLIC_ORIGIN"