Skip to content

refactor e2e preparation and type generation scripts for improved err… #319

refactor e2e preparation and type generation scripts for improved err…

refactor e2e preparation and type generation scripts for improved err… #319

name: Deploy Coong to Vercel

Check failure on line 1 in .github/workflows/coong-vercel-deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/coong-vercel-deploy.yml

Invalid workflow file

(Line: 70, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.TARGET_DEPLOY_BRANCH
on:
push:
branches:
# build only
- dev
# build and deploy
- release/coong
env:
PNPM_VERSION: 9
NODE_VERSION: 20
PROJECT_CLIENT_PATH: apps/coong-client
ARTIFACT_CLIENT_NAME: dist-client
TARGET_DEPLOY_BRANCH: release/coong
jobs:
build-client:
name: Build Client
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Prepare Pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.NODE_VERSION }}
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Unit Test
run: pnpm run test
- name: Build
run: pnpm run build:coong-client
- name: Archive Production Artifact
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: ${{ env.ARTIFACT_CLIENT_NAME }}
path: |
${{ env.PROJECT_CLIENT_PATH }}/dist
deploy-client:
name: Deploy Client
runs-on: ubuntu-latest
needs: build-client
if: github.ref == 'refs/heads/${{ env.TARGET_DEPLOY_BRANCH }}'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: ${{ env.ARTIFACT_CLIENT_NAME }}
path: ${{ env.PROJECT_CLIENT_PATH }}/dist
- name: Deploy
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: pnpm exec vercel --prod --cwd ${{ env.PROJECT_CLIENT_PATH }}/dist/spa