fix: cloudbuild yaml
This commit is contained in:
parent
dea382a8c9
commit
951bc2b40a
|
|
@ -12,6 +12,8 @@ WORKDIR /app
|
|||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
ARG NEXT_PUBLIC_API_URL
|
||||
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
||||
ENV NODE_ENV=production
|
||||
RUN npm run build
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
steps:
|
||||
- name: gcr.io/cloud-builders/docker
|
||||
id: Build image
|
||||
args:
|
||||
- build
|
||||
- -f
|
||||
- Dockerfile
|
||||
- --build-arg
|
||||
- NEXT_PUBLIC_API_URL=${_NEXT_PUBLIC_API_URL}
|
||||
- -t
|
||||
- ${_AR_HOSTNAME}/${_AR_PROJECT_ID}/${_AR_REPOSITORY}/${_SERVICE_NAME}:latest
|
||||
- -t
|
||||
- ${_AR_HOSTNAME}/${_AR_PROJECT_ID}/${_AR_REPOSITORY}/${_SERVICE_NAME}:${SHORT_SHA}
|
||||
- .
|
||||
|
||||
- name: gcr.io/cloud-builders/docker
|
||||
id: Push latest
|
||||
args:
|
||||
- push
|
||||
- ${_AR_HOSTNAME}/${_AR_PROJECT_ID}/${_AR_REPOSITORY}/${_SERVICE_NAME}:latest
|
||||
|
||||
- name: gcr.io/cloud-builders/docker
|
||||
id: Push commit tag
|
||||
args:
|
||||
- push
|
||||
- ${_AR_HOSTNAME}/${_AR_PROJECT_ID}/${_AR_REPOSITORY}/${_SERVICE_NAME}:${SHORT_SHA}
|
||||
|
||||
- name: gcr.io/google.com/cloudsdktool/cloud-sdk:slim
|
||||
id: Deploy to Cloud Run
|
||||
entrypoint: gcloud
|
||||
args:
|
||||
- run
|
||||
- deploy
|
||||
- ${_SERVICE_NAME}
|
||||
- --image
|
||||
- ${_AR_HOSTNAME}/${_AR_PROJECT_ID}/${_AR_REPOSITORY}/${_SERVICE_NAME}:${SHORT_SHA}
|
||||
- --region
|
||||
- ${_DEPLOY_REGION}
|
||||
- --platform
|
||||
- ${_PLATFORM}
|
||||
- --quiet
|
||||
|
||||
images:
|
||||
- ${_AR_HOSTNAME}/${_AR_PROJECT_ID}/${_AR_REPOSITORY}/${_SERVICE_NAME}:latest
|
||||
- ${_AR_HOSTNAME}/${_AR_PROJECT_ID}/${_AR_REPOSITORY}/${_SERVICE_NAME}:${SHORT_SHA}
|
||||
|
||||
options:
|
||||
logging: CLOUD_LOGGING_ONLY
|
||||
Loading…
Reference in New Issue