'Deploy a specific subfolder with cloud-run github action when working with a monorepo
I am working with a mono repo and I would like to deploy my back-end (only) with the Cloud Run service (using the "official" google cloud run action). For this action, I need a Dockerfile at the root of my project for building my image. But my Dockerfile is under ./server.
Is there a way to use something like working-directory for the run steps ? I didn't find anything from the doc.
Or do I have to have a Dockerfile at the root of my project and the Dockerfile points to the ./server?
My project tree :
./
.github/
worflows/
deploy-back.yml
client/
...
server/
...
Dockerfile
# deploy-back.yml
name: Deploy to production
# ...
jobs:
deployment-job:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v2
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0
with:
# ...
- name: Deploy to Cloud Run
uses: google-github-actions/deploy-cloudrun@v0
with:
service: ${{ env.SERVICE_NAME }}
source: gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE_NAME }}:${{ env.PACKAGE_VERSION }}
project_id: ${{ env.PROJECT_ID }}
region: ${{ env.RUN_REGION }}
tag: ${{ env.PACKAGE_VERSION }}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
