From d420b79ef717e8122f7cadc81e898035c9940e64 Mon Sep 17 00:00:00 2001 From: SKairinos Date: Fri, 24 May 2024 15:19:08 +0100 Subject: [PATCH] deploy to gcp --- .github/workflows/deploy-service.yaml | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/deploy-service.yaml diff --git a/.github/workflows/deploy-service.yaml b/.github/workflows/deploy-service.yaml new file mode 100644 index 00000000..c7508679 --- /dev/null +++ b/.github/workflows/deploy-service.yaml @@ -0,0 +1,34 @@ +name: Deploy Service + +on: + workflow_call: + secrets: + GCP_CREDENTIALS: + description: "The JSON credentials used to access GCP." + required: true + +jobs: + deploy: + runs-on: ubuntu-latest + # if: github.ref_name == 'production' || github.ref_name == 'development' || github.ref_name == 'staging' + environment: ${{ github.ref_name }} + steps: + - name: 🛫 Checkout + uses: actions/checkout@v4 + + # https://mikefarah.gitbook.io/yq/ + - name: 🖊️ Configure App Deployment + uses: mikefarah/yq@master + with: + cmd: | + name=${{ github.repository }} + name=${name#"ocadotechnology/codeforelife-"} + + yq -i ' + .service = "${{ github.ref_name }}-$name" + ' app.yaml + + - name: 🚀 Deploy App on GCloud + uses: ocadotechnology/codeforlife-workspace/.github/actions/gcloud/deploy-app@configure_js_services # TODO: set to @main + with: + gcp-credentials: ${{ secrets.GCP_CREDENTIALS }}