prevent double writes to worker in GCS, port to newer GCP auth workflow

This commit is contained in:
41666 2022-01-30 17:32:14 -05:00
parent c38e1b129a
commit 9ae9c104ef

View file

@ -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