File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 4141 gsutil -q -m rm -r gs://${STAGING_BUCKET}/staging/${BRANCH_TO_CLEANUP}/*
4242 echo "Removed gs://${STAGING_BUCKET}/staging/${BRANCH_TO_CLEANUP}"
4343 fi
44+
45+ prod :
46+ if : github.event.pull_request.merged == true
47+ runs-on : ubuntu-latest
48+ permissions :
49+ contents : ' read'
50+ id-token : ' write'
51+ env :
52+ PROD_BUCKET : docs-prod-learn-redis-com
53+ PROD_PROJECT_ID : ${{ secrets.GCP_PROJECT_PROD }}
54+ PROD_SERVICE_ACCOUNT : ${{ secrets.PROD_SERVICE_ACCOUNT }}
55+ PROD_WORKLOAD_IDENTITY_PROVIDER : ${{ secrets.PROD_WORKLOAD_IDENTITY_PROVIDER }}
56+
57+ steps :
58+ - name : ' Google auth'
59+ uses : ' google-github-actions/auth@v2'
60+ with :
61+ project_id : ' ${{ env.PROD_PROJECT_ID }}'
62+ service_account : ' ${{ env.PROD_SERVICE_ACCOUNT }}'
63+ workload_identity_provider : ' ${{ env.PROD_WORKLOAD_IDENTITY_PROVIDER }}'
64+
65+ - name : ' Set up Cloud SDK'
66+ uses : ' google-github-actions/setup-gcloud@v2'
67+ with :
68+ project_id : ' ${{ env.PROD_PROJECT_ID }}'
69+ version : ' >= 363.0.0'
70+
71+ - name : Remove pull request staging folder
72+ run : |
73+ BRANCH_TO_CLEANUP="${{ github.event.pull_request.head.ref }}"
74+ PROD_BUCKET="${{ env.PROD_BUCKET }}"
75+
76+ if gsutil -q stat gs://${PROD_BUCKET}/staging/${BRANCH_TO_CLEANUP}/*; then
77+ gsutil -q -m rm -r gs://${PROD_BUCKET}/staging/${BRANCH_TO_CLEANUP}/*
78+ echo "Removed gs://${PROD_BUCKET}/staging/${BRANCH_TO_CLEANUP}"
79+ fi
You can’t perform that action at this time.
0 commit comments