Fix landing #614
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
name: CD | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
CLOUDFLARE_DEFAULT_ACCOUNT_ID: f02b3ef168fe64129e9941b4fb2e4dc1 | |
jobs: | |
landing: | |
name: Landing | |
runs-on: ubuntu-latest | |
environment: | |
name: landing | |
url: ${{ steps.result.outputs.DEPLOYMENT_URL }} | |
env: | |
VITE_MATTRAX_CLOUD_ORIGIN: https://web.mattrax.app | |
steps: | |
- name: Git clone the repository | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Install dependencies | |
run: pnpm i | |
- name: Build | |
working-directory: apps/landing | |
env: | |
NITRO_PRESET: cloudflare_pages | |
run: pnpm build | |
- name: Deploy | |
working-directory: apps/landing | |
run: | | |
set -o pipefail | |
pnpm dlx wrangler pages deploy dist/ --project-name landing 2>&1 | tee -a BUILD_OUTPUT | |
- name: Export `DEPLOYMENT_URL` | |
id: result | |
run: echo "DEPLOYMENT_URL=$(grep -Eo 'https://[^ >]+' BUILD_OUTPUT|head -1)" >> $GITHUB_OUTPUT | |
web: | |
name: Web | |
runs-on: ubuntu-latest | |
environment: | |
name: web | |
url: ${{ steps.result.outputs.DEPLOYMENT_URL }} | |
steps: | |
- name: Git clone the repository | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Install dependencies | |
run: pnpm i | |
- name: Build | |
working-directory: apps/web | |
env: | |
NITRO_PRESET: cloudflare_pages | |
run: pnpm build | |
- name: Deploy | |
working-directory: apps/web | |
run: | | |
set -o pipefail | |
pnpm dlx wrangler pages deploy dist/ --project-name web 2>&1 | tee -a BUILD_OUTPUT | |
- name: Export `DEPLOYMENT_URL` | |
id: result | |
run: echo "DEPLOYMENT_URL=$(grep -Eo 'https://[^ >]+' BUILD_OUTPUT|head -1)" >> $GITHUB_OUTPUT | |
api: | |
name: API | |
runs-on: ubuntu-latest | |
environment: | |
name: api | |
url: ${{ steps.result.outputs.DEPLOYMENT_URL }} | |
steps: | |
- name: Git clone the repository | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Install dependencies | |
run: pnpm i | |
- name: Build | |
working-directory: apps/api | |
env: | |
NITRO_PRESET: cloudflare_pages | |
run: pnpm build | |
- name: Deploy | |
working-directory: apps/api | |
run: | | |
set -o pipefail | |
pnpm dlx wrangler deploy src/index.ts --define "import.meta.env.GIT_SHA:$(git rev-parse HEAD)" 2>&1 | tee -a BUILD_OUTPUT | |
- name: Export `DEPLOYMENT_URL` | |
id: result | |
run: echo "DEPLOYMENT_URL=$(grep -Eo 'https://[^ >]+' BUILD_OUTPUT|head -1)" >> $GITHUB_OUTPUT |