Only run gcloud build when it's a push

This commit is contained in:
Deirdre Connolly 2020-05-15 23:12:54 -04:00 committed by Deirdre Connolly
parent 77b42d2048
commit 796eddfb25
1 changed files with 15 additions and 14 deletions

View File

@ -10,20 +10,21 @@ on:
jobs: jobs:
# build: build:
# name: Google Cloud Build name: Google Cloud Build
# runs-on: ubuntu-latest if: github.head_ref || github.base_ref # This is a pull request, and would fail for external PRs.
# steps: runs-on: ubuntu-latest
# - uses: actions/checkout@master steps:
# - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master - uses: actions/checkout@master
# with: - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
# version: '275.0.0' with:
# service_account_key: ${{ secrets.GCLOUD_AUTH }} version: '275.0.0'
# - name: Build, Test, Push to GCR service_account_key: ${{ secrets.GCLOUD_AUTH }}
# run: | - name: Build, Test, Push to GCR
# BRANCH_NAME=$GITHUB_REPOSITORY/$(expr $GITHUB_REF : '.*/\(.*\)') && \ run: |
# BRANCH_NAME=${BRANCH_NAME,,} && \ BRANCH_NAME=$GITHUB_REPOSITORY/$(expr $GITHUB_REF : '.*/\(.*\)') && \
# gcloud builds submit . --config cloudbuild.yaml --project zealous-zebra --substitutions BRANCH_NAME=$BRANCH_NAME BRANCH_NAME=${BRANCH_NAME,,} && \
gcloud builds submit . --config cloudbuild.yaml --project zealous-zebra --substitutions BRANCH_NAME=$BRANCH_NAME
test: test:
name: Build and test on ${{ matrix.os }} name: Build and test on ${{ matrix.os }}