From b3b6894fde906ad7601388c2839f9757a94a94f5 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Mon, 9 Dec 2019 17:12:58 -0500 Subject: [PATCH] Add GitHub Actions workflow which runs Google Cloudbuild jobs --- .github/workflows/main.yml | 24 ++++++++++++++++++++++++ cloudbuild.yaml | 11 +++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 cloudbuild.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c4b0324 --- /dev/null +++ b/.github/workflows/main.yml @@ -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" diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 0000000..f531a90 --- /dev/null +++ b/cloudbuild.yaml @@ -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.