From 9ae9c104ef0da7c3a752417d1546fce4ab44d559 Mon Sep 17 00:00:00 2001 From: Katalina Okano Date: Sun, 30 Jan 2022 17:32:14 -0500 Subject: [PATCH] prevent double writes to worker in GCS, port to newer GCP auth workflow --- .github/workflows/build.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d942321..6af026a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,17 +49,21 @@ jobs: with: node-version: '16' + - id: 'auth' + uses: 'google-github-actions/auth@v0' + with: + credentials_json: '${{ secrets.GCS_TF_KEY }}' + - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@master + uses: google-github-actions/setup-gcloud@v0 with: project_id: ${{ secrets.GCS_PROJECT_ID }} - service_account_key: ${{ secrets.GCS_TF_KEY }} export_default_credentials: true - name: Check if already deployed id: check run: | - gsutil stat gs://roleypoly-artifacts/workers/${{ github.sha }}/${{ matrix.worker }}.js \ + gsutil stat gs://roleypoly-artifacts/workers/${{ github.sha }}/index.mjs \ && echo ::set-output name=skip::1 \ || echo ::set-output name=skip::0 @@ -90,7 +94,6 @@ jobs: with: path: packages/api/dist/index.mjs destination: roleypoly-artifacts/workers/${{ github.sha }} - credentials: ${{ secrets.GCS_TF_KEY }} docker_build: name: Docker Build & Publish @@ -159,7 +162,7 @@ jobs: needs: - docker_build - worker_build - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/miniflare' runs-on: ubuntu-latest steps: - name: Get Bot digest