From 863eee3054eb12f64c35361ccd21c15a50bb1add Mon Sep 17 00:00:00 2001 From: Yuru Shao Date: Fri, 7 Jun 2024 17:37:37 -0700 Subject: [PATCH] test triggering on PRs --- .github/workflows/deploy_api.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy_api.yml b/.github/workflows/deploy_api.yml index 55b5cc5f..1174903a 100644 --- a/.github/workflows/deploy_api.yml +++ b/.github/workflows/deploy_api.yml @@ -1,6 +1,9 @@ name: Deploy api to GAE on: + pull_request: + branches: ["main"] + workflow_dispatch: inputs: environment: @@ -18,6 +21,14 @@ jobs: build-test-deploy: runs-on: ubuntu-latest steps: + - name: GCP auth + uses: google-github-actions/auth@v2 + with: + credentials_json: ${{ secrets.GCP_CREDENTIALS }} + + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v2 + - name: Checkout uses: actions/checkout@v4 @@ -51,13 +62,5 @@ jobs: - name: Run tests run: pnpm api-test - - name: GCP auth - uses: google-github-actions/auth@v2 - with: - credentials_json: ${{ secrets.GCP_CREDENTIALS }} - - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v2 - - nmae: Deploy to GAE run: gcloud info && ./deploy_api.sh --${{ inputs.environment }}