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

Working Github actions-pipeline, testing nightly #250

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
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
31 changes: 20 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ on:
type: boolean
description: int
default: false

workflow_call:
inputs:
environment:
type: string
description: Deployment environment
required: true

jobs:
calculate-matrix:
runs-on: ubuntu-latest
Expand All @@ -42,11 +42,20 @@ jobs:
id: calculate-deploy-matrix
with:
script: |
const { calculateEnvironment } = await import('${{github.workspace}}/.github/workflows/utils.js');

const inputs = ${{toJSON(inputs)}}
const environment = calculateEnvironment(inputs)

if (inputs.environment) {
return { environment: JSON.parse(inputs.environment) }
}
const environment = Object.entries({
dev: inputs.deployToDev,
int: inputs.deployToInt,
staging: inputs.deployToStaging,
beta: inputs.deployToBeta,
prod: inputs.deployToProd,
})
.map(([env, include]) => (include ? env : undefined))
.filter(Boolean)

return { environment }

deploy-bff-search:
Expand All @@ -63,16 +72,16 @@ jobs:
- name: Build and test
uses: ./.github/actions/build-and-test

- name: Populate Google application credentials
uses: google-github-actions/auth@v2
with:
credentials_json: ${{secrets.FIREBASE_DEPLOY_CREDENTIALS}}
- name: Set gcloud Auth
run: echo $FIREBASE_DEPLOY_CREDENTIALS | gcloud auth activate-service-account --key-file=-
env:
FIREBASE_DEPLOY_CREDENTIALS: ${{secrets.FIREBASE_DEPLOY_CREDENTIALS}}

- name: Set gcloud project
run: gcloud --quiet config set project << parameters.project >>
run: gcloud --quiet config set project ${{vars.GCP_PROJECT}}

- name: Upload type defs to GCP bucket
run: gsutil cp typeDeclarations.tar.gz "gs://<< parameters.project >>-search-types/"
run: gsutil cp typeDeclarations.tar.gz "gs://${{vars.GCP_PROJECT}}-search-types/"

- name: Deploy to Google App Engine
run: gcloud app deploy ./app-${{matrix.environment}}.yaml cron.yaml --quiet --verbosity=info
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Nightly Deploy

on:
schedule: # Times are in UTC
# - cron: '0 5 * * 1-5'
- cron: '0 15 * * 1-5'

jobs:
deploy-bff:
uses: ./.github/workflows/deploy.yml
secrets: inherit
with:
environment: '["dev", "int", "staging", "beta"]'
Loading