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 }}