Skip to content

Deploy Client through ci/cd. #26

Deploy Client through ci/cd.

Deploy Client through ci/cd. #26

Workflow file for this run

name: Client CI/CD
on:
push:
paths:
- 'client/**'
- '.github/workflows/client.yaml*'
defaults:
run:
working-directory: client
env:
GOOGLE_CREDENTIALS: ${{ secrets.GCP_CD }}
REGION: 'us-west2'
PROJECT: "artist-2d"
SERVICE_NAME: "artist-2d-client"
jobs:
build:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
env:
NODE_OPTIONS: "--openssl-legacy-provider"
- run: npm test
deploy-gcr:
name: Deploy to GCR
#needs: build
runs-on: ubuntu-latest
#if: github.ref == 'refs/heads/main'
env:
IMAGE_TAG: "gcr.io/${{ env.PROJECT }}/client:${GITHUB_SHA}"

Check failure on line 47 in .github/workflows/client.yaml

View workflow run for this annotation

GitHub Actions / Client CI/CD

Invalid workflow file

The workflow is not valid. .github/workflows/client.yaml (Line: 47, Col: 18): Unrecognized named-value: 'env'. Located at position 1 within expression: env.PROJECT
steps:
- name: Checkout Repo
uses: actions/checkout@main
- run: echo "${IMAGE_TAG}"
- run: echo "${{ env.IMAGE_TAG }}"
- run: echo "${PROJECT}"
- run: echo "${{ env.PROJECT }}"
- uses: 'actions/checkout@v4'
- name: Setup GCloud Auth
id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CD }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
# Build and push image to Google Container Registry
- name: Build & Push
run: gcloud builds submit --tag ${IMAGE_TAG}
# Deploy image to Cloud Run
- name: Deploy GCR
run: |-
gcloud run deploy "$SERVICE_NAME" \
--quiet \
--region "${REGION}" \
--image "${{ env.IMAGE_TAG }}" \
--platform "managed" \
--allow-unauthenticated