Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Build and store assets in a bucket #73

Merged
merged 3 commits into from
May 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 31 additions & 9 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
id: build-potal
args: [ 'build', '-f', './docker/potal/Dockerfile', '-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/potal/potal:latest', '.']
waitFor: ['-']
- name: 'gcr.io/cloud-builders/docker'
id: push-potal
args: [ 'push', 'us-central1-docker.pkg.dev/$PROJECT_ID/potal/potal:latest']
waitFor: ['build-potal']
- name: 'gcr.io/cloud-builders/docker'
id: build-backend
args: [ 'build', '-f', './docker/backend/Dockerfile', '-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/backend/backend:latest', '.']
waitFor: ['-']
- name: 'gcr.io/cloud-builders/docker'
id: push-backend
args: [ 'push', 'us-central1-docker.pkg.dev/$PROJECT_ID/backend/backend:latest']
- name: 'gcr.io/cloud-builders/docker'
args: [ 'push', 'us-central1-docker.pkg.dev/$PROJECT_ID/potal/potal:latest']
waitFor: ['build-backend']
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
Expand All @@ -17,16 +25,30 @@ steps:
- 'us-central1-docker.pkg.dev/$PROJECT_ID/potal/potal:latest'
- '--region'
- 'us-central1'
waitFor: ['push-backend', 'push-potal']
- name: 'gcr.io/cloud-builders/npm'
id: 'npm-install'
args: ['install', '--frozen-lock']
waitFor: ['-']
- name: 'gcr.io/cloud-builders/npm'
id: 'build-assets'
args: ['run', 'build']
waitFor: ['npm-install']
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'backend'
- '--image'
- 'us-central1-docker.pkg.dev/$PROJECT_ID/backend/backend:latest'
- '--region'
- 'us-central1'
- 'storage'
- 'cp'
- 'webroot/assets/*'
- 'webroot/manifest.json'
- 'gs://gib-potato-assets'
waitFor: ['build-assets']
images:
- 'us-central1-docker.pkg.dev/$PROJECT_ID/backend/backend:latest'
- 'us-central1-docker.pkg.dev/$PROJECT_ID/potal/potal:latest'
artifacts:
objects:
location: gs://gib-potato-assets/
paths:
- 'webroot/assets/*'
- 'webroot/manifest.json'