-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace python cloudbuilds w/ gcloud + static config files
- Loading branch information
Showing
11 changed files
with
139 additions
and
185 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.webassets-cache/ | ||
*.sqlite3 | ||
**/static/style.css | ||
postgres-data/ | ||
tmp-certs/ | ||
.terraform/ | ||
.git/ | ||
.DS_Store | ||
*.pyc | ||
.vscode/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Cloud Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
command: | ||
description: "The justfile + Cloud build-related recipe to run" | ||
required: true | ||
type: string | ||
outputs: | ||
image: | ||
description: "GCR image produced by the command where applicable" | ||
value: ${{ jobs.run_cloudbuild_command.outputs.image }} | ||
|
||
jobs: | ||
run_cloudbuild_command: | ||
name: Submit Build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
outputs: | ||
image: ${{ steps.cloudbuild-command.outputs.image }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup just | ||
uses: extractions/setup-just@v1 | ||
|
||
- name: Authenticate to Google Cloud | ||
uses: google-github-actions/auth@v0 | ||
with: | ||
workload_identity_provider: "projects/567739286055/locations/global/workloadIdentityPools/los-verdes-digital-membership/providers/los-verdes-digital-membership" | ||
service_account: "[email protected]" | ||
access_token_scopes: "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/sqlservice.admin" | ||
token_format: access_token | ||
access_token_lifetime: 1800s | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v0 | ||
|
||
- name: Build | ||
run: just ${{ inputs.command }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ postgres-data/ | |
.srl | ||
tmp-certs/ | ||
member_card/static/style.css | ||
.terraform/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
substitutions: | ||
_IMAGE_TAG: "n/a" | ||
_BUCKET_ID: "statics-gcs-bucket" | ||
|
||
steps: | ||
- name: "gcr.io/$PROJECT_ID/website:${_IMAGE_TAG}" | ||
entrypoint: "flask" | ||
args: | ||
- assets | ||
- build | ||
|
||
- name: "gcr.io/cloud-builders/gsutil" | ||
args: | ||
- "-m" | ||
- "cp" | ||
- "-r" | ||
- "member_card/static/*" | ||
- f"gs://${_BUCKET_ID}/static/" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
substitutions: | ||
_IMAGE_TAG: "n/a" | ||
_BUILD_TARGET: website | ||
|
||
steps: | ||
# Download image to cache from | ||
- name: "gcr.io/cloud-builders/docker" | ||
entrypoint: "bash" | ||
args: | ||
- "-c" | ||
- "docker pull gcr.io/$PROJECT_ID/worker:latest || exit 0" | ||
|
||
# Docker Build | ||
- name: "gcr.io/cloud-builders/docker" | ||
args: | ||
- "build" | ||
- "--cache-from=gcr.io/$PROJECT_ID/${_BUILD_TARGET}:latest" | ||
- "--target=${_BUILD_TARGET}" | ||
- "--tag=gcr.io/$PROJECT_ID/${_BUILD_TARGET}:${_IMAGE_TAG}" | ||
- "." | ||
|
||
- name: "gcr.io/cloud-builders/docker" | ||
args: | ||
- "tag" | ||
- "gcr.io/$PROJECT_ID/${_BUILD_TARGET}:${_IMAGE_TAG}" | ||
- "gcr.io/$PROJECT_ID/${_BUILD_TARGET}:latest" | ||
|
||
images: | ||
- "gcr.io/$PROJECT_ID/${_BUILD_TARGET}:${_IMAGE_TAG}" | ||
- "gcr.io/$PROJECT_ID/${_BUILD_TARGET}:latest" |
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
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.