Update test for new code. #3
Workflow file for this run
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-client | ||
on: | ||
push: | ||
paths: | ||
'client/**' | ||
#branches: | ||
# 'main' | ||
defaults: | ||
run: | ||
working-directory: client | ||
env: | ||
REGION: 'us-west2' | ||
GOOGLE_CREDENTIALS: ${{ secrets.GCP_CD }} | ||
PROJECT: "artist-2d" | ||
jobs: | ||
deploy-gcr: | ||
name: Deploy to GCR | ||
needs: build | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE_TAG: 'gcr.io/${PROJECT}/client:${GITHUB_SHA}' | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@main | ||
- name: Download Artifact | ||
uses: actions/download-artifact@main | ||
with: | ||
name: build | ||
path: .docker/build | ||
- name: Setup GCloud Auth | ||
id: auth | ||
uses: google-github-actions/[email protected] | ||
with: | ||
credentials_json: ${{ inputs.GCR_SA_KEY }} | ||
- name: Set up Cloud SDK | ||
uses: google-github-actions/[email protected] | ||
# Build and push image to Google Container Registry | ||
- name: Build & Push | ||
run: |- | ||
gcloud builds submit \ | ||
--quiet \ | ||
--tag "${IMAGE_TAG}" | ||
working-directory: .docker | ||
# Deploy image to Cloud Run | ||
- name: Deploy GCR | ||
run: |- | ||
gcloud run deploy "$SERVICE_NAME" \ | ||
--quiet \ | ||
--region "${REGION}" \ | ||
--image "${IMAGE_TAG}" \ | ||
--platform "managed" \ | ||
--allow-unauthenticated | ||