File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ on :
2+ pull_request :
3+ types :
4+ - closed
5+
6+ jobs :
7+ if_merged :
8+ if : github.event.pull_request.merged == true
9+ runs-on : ubuntu-latest
10+ env :
11+ STAGING_BUCKET : docs-staging-learn-redis-com
12+ STAGING_PROJECT_ID : ${{ secrets.GCP_PROJECT_STAGING }}
13+ STAGING_SERVICE_ACCOUNT : ${{ secrets.STAGING_SERVICE_ACCOUNT }}
14+ STAGING_WORKLOAD_IDENTITY_PROVIDER : ${{ secrets.STAGING_WORKLOAD_IDENTITY_PROVIDER }}
15+
16+ steps :
17+ - name : ' Google auth'
18+ uses : ' google-github-actions/auth@v2'
19+ with :
20+ project_id : ' ${{ env.STAGING_PROJECT_ID }}'
21+ service_account : ' ${{ env.STAGING_SERVICE_ACCOUNT }}'
22+ workload_identity_provider : ' ${{ env.STAGING_WORKLOAD_IDENTITY_PROVIDER }}'
23+
24+ - name : ' Set up Cloud SDK'
25+ uses : ' google-github-actions/setup-gcloud@v2'
26+ with :
27+ project_id : ' ${{ env.STAGING_PROJECT_ID }}'
28+ version : ' >= 363.0.0'
29+
30+ - name : Remove pull request staging folder
31+ run : |
32+ BRANCH_TO_CLEANUP="${{ github.event.pull_request.head.ref }}"
33+ STAGING_BUCKET="${{ env.STAGING_BUCKET }}"
34+
35+ if gsutil -q stat gs://${STAGING_BUCKET}/staging/${BRANCH_TO_CLEANUP}/*; then
36+ gsutil -q -m rm -r gs://${STAGING_BUCKET}/staging/${BRANCH_TO_CLEANUP}/*
37+ echo "Removed gs://${STAGING_BUCKET}/staging/${BRANCH_TO_CLEANUP}"
38+ fi
You can’t perform that action at this time.
0 commit comments