Skip to content

update

update #995

Workflow file for this run

name: Build and Deploy Coong

Check failure on line 1 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yml

Invalid workflow file

(Line: 71, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.TARGET_DEPLOY_BRANCH
on:
push:
branches:
# stop deploy for now
- dev-none
# stop deploy for now
- release/coong-none
env:
PNPM_VERSION: 9.1.4
NODE_VERSION: 20
GCP_SERVICE_NAME: coong
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@master
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Prepare Pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: ${{ env.PNPM_VERSION }}
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.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@master
with:
retention-days: 1
name: ${{ env.ARTIFACT_CLIENT_NAME }}
path: |
${{ env.PROJECT_CLIENT_PATH }}/dist
deploy-client:
name: Deploy Client
needs: build-client
runs-on: ubuntu-latest
# only master
if: github.ref == 'refs/heads/${{ env.TARGET_DEPLOY_BRANCH }}'
env:
DESTINATION: coong-static-production
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: ${{ env.ARTIFACT_CLIENT_NAME }}
path: ${{ env.PROJECT_CLIENT_PATH }}/dist
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- id: upload-file
uses: google-github-actions/upload-cloud-storage@v2
with:
path: ${{ env.PROJECT_CLIENT_PATH }}/dist/spa
parent: false
destination: ${{ env.DESTINATION }}