From 3de871c814e98dace0258cda1dbd141c50a53786 Mon Sep 17 00:00:00 2001 From: James Lott Date: Tue, 22 Aug 2023 12:29:26 -0400 Subject: [PATCH] .github/workflows: add stg environment deployment --- .github/workflows/stg_web_client_merge.yml | 51 ++++++++++++++++++++++ .github/workflows/stg_web_svc_merge.yml | 51 ++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 .github/workflows/stg_web_client_merge.yml create mode 100644 .github/workflows/stg_web_svc_merge.yml diff --git a/.github/workflows/stg_web_client_merge.yml b/.github/workflows/stg_web_client_merge.yml new file mode 100644 index 0000000000..92c82cb424 --- /dev/null +++ b/.github/workflows/stg_web_client_merge.yml @@ -0,0 +1,51 @@ +name: Web client staging CD + +on: + push: + branches: + - master + +jobs: + + web_cd: + name: Deploy web client + runs-on: ubuntu-latest + + env: + ENV_NAME : stg + CLOUDSDK_CORE_PROJECT : web-based-gtfs-validator + + steps: + + - uses: actions/checkout@v3 + with: + # We need to download all tags so that the axion-release-plugin + # can resolve the most recent version tag. + fetch-depth: 0 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + # We need a recent version of Java with jpackage included. + java-version: '17' + # We use the zulu distribution, which is an OpenJDK distro. + distribution: 'zulu' + + # for npm + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - uses: google-github-actions/auth@v1 + with: + credentials_json: ${{ secrets.GCP_WEB_VALIDATOR_SA_KEY }} + + - uses: google-github-actions/setup-gcloud@v1 + with: + version: '>= 390.0.0' + + - name: run gradle tasks + shell: bash + run: | + ENV_FILE=web/pipeline/${ENV_NAME}.env source web/pipeline/env-file.sh + ./gradlew ':web:client:webDeploy' diff --git a/.github/workflows/stg_web_svc_merge.yml b/.github/workflows/stg_web_svc_merge.yml new file mode 100644 index 0000000000..e8c1b7b9e7 --- /dev/null +++ b/.github/workflows/stg_web_svc_merge.yml @@ -0,0 +1,51 @@ +name: Web service staging CD + +on: + push: + branches: + - master + +jobs: + + web_cd: + name: Deploy web service + runs-on: ubuntu-latest + + env: + ENV_NAME : stg + CLOUDSDK_CORE_PROJECT : web-based-gtfs-validator + + steps: + + - uses: actions/checkout@v3 + with: + # We need to download all tags so that the axion-release-plugin + # can resolve the most recent version tag. + fetch-depth: 0 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + # We need a recent version of Java with jpackage included. + java-version: '17' + # We use the zulu distribution, which is an OpenJDK distro. + distribution: 'zulu' + + # for npm + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - uses: google-github-actions/auth@v1 + with: + credentials_json: ${{ secrets.GCP_WEB_VALIDATOR_SA_KEY }} + + - uses: google-github-actions/setup-gcloud@v1 + with: + version: '>= 390.0.0' + + - name: run gradle tasks + shell: bash + run: | + ENV_FILE=web/pipeline/${ENV_NAME}.env source web/pipeline/env-file.sh + ./gradlew ':web:service:webDeploy'