Add GitHub Actions workflow which runs Google Cloudbuild jobs

This commit is contained in:
Deirdre Connolly 2019-12-09 17:12:58 -05:00 committed by Deirdre Connolly
parent 5be929559b
commit b3b6894fde
2 changed files with 35 additions and 0 deletions

24
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,24 @@
name: CI
on: [push]
jobs:
build:
name: Google Cloud Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
# - run:
- name: Authenticate w/ Google Cloud
uses: actions/gcloud/auth@master
env:
GCLOUD_AUTH: ${{ secrets.GCLOUD_AUTH }}
- name: Build, Test, Push to GCR
uses: actions/gcloud/cli@master
with:
entrypoint: bash
args: |
-l -c "BRANCH_NAME=$GITHUB_REPOSITORY/$(expr $GITHUB_REF : '.*/\(.*\)') && \
BRANCH_NAME=${BRANCH_NAME,,} && \
gcloud builds submit . --config cloudbuild.yaml --project zealous-zebra --substitutions BRANCH_NAME=$BRANCH_NAME"

11
cloudbuild.yaml Normal file
View File

@ -0,0 +1,11 @@
steps:
- name: 'gcr.io/kaniko-project/executor:latest'
args:
- --destination=gcr.io/$PROJECT_ID/$BRANCH_NAME
- --cache=true
- --cache-ttl=24h
options:
machineType: 'N1_HIGHCPU_32'
timeout: 3600s # One hour for all steps.