From 67fe5dbde770568dc785bd4584c765c206518621 Mon Sep 17 00:00:00 2001 From: Andromachi Rozaki Date: Tue, 11 Jun 2024 15:26:47 +0200 Subject: [PATCH] message --- .github/workflows/preview-env-deploy.yml | 5 ++++- .github/workflows/preview-env-teardown.yml | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/preview-env-deploy.yml b/.github/workflows/preview-env-deploy.yml index d1ac0c6554..7d30bca0ae 100644 --- a/.github/workflows/preview-env-deploy.yml +++ b/.github/workflows/preview-env-deploy.yml @@ -5,6 +5,7 @@ on: jobs: deploy-preview: #if: github.event.pull_request.state != 'closed' && (contains( github.event.label.name, 'deploy') || contains( github.event.pull_request.labels.*.name, 'deploy')) + if: github.event.pull_request.state == 'closed' runs-on: ubuntu-22.04 timeout-minutes: 40 name: deploy-preview-env @@ -32,6 +33,8 @@ jobs: run: npm run build env: NODE_OPTIONS: --max_old_space_size=8192 + URL: https://somebucket + BASE_URL: /pr-${{ github.event.number }} - name: Authenticate with Google Cloud uses: google-github-actions/auth@v2 @@ -46,7 +49,7 @@ jobs: - name: Upload files to google bucket env: BUCKET_NAME: ${{ steps.secrets.outputs.TEMP_BUCKET }} - run: | + run: | gcloud config set pass_credentials_to_gsutil true gsutil -m cp -R build/* gs://$BUCKET_NAME/pr-${{ github.event.number }}/ diff --git a/.github/workflows/preview-env-teardown.yml b/.github/workflows/preview-env-teardown.yml index b4a5bbe5dc..a4b0c010a4 100644 --- a/.github/workflows/preview-env-teardown.yml +++ b/.github/workflows/preview-env-teardown.yml @@ -1,11 +1,10 @@ name: preview-env-teardown on: pull_request: - types: [labeled, synchronize] jobs: deploy-preview: - #if: github.event.pull_request.state != 'closed' && (contains( github.event.label.name, 'deploy') || contains( github.event.pull_request.labels.*.name, 'deploy')) + #if: github.event.label.name == 'deploy' || (github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'deploy') ) runs-on: ubuntu-22.04 timeout-minutes: 20 name: teardown-preview-env @@ -39,7 +38,7 @@ jobs: - name: Remove files from Google bucket env: BUCKET_NAME: ${{ steps.secrets.outputs.TEMP_BUCKET }} - run: | + run: | gcloud config set pass_credentials_to_gsutil true gsutil -m rm -r gs://$BUCKET_NAME/pr-${{ github.event.number }}/