-
Notifications
You must be signed in to change notification settings - Fork 40
32 lines (31 loc) · 1.13 KB
/
pr_close.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: PR - Closed
on:
pull_request:
types: [closed]
jobs:
dev-pr-close-s3:
runs-on: ubuntu-latest
environment: dev
steps:
- name: Empty Website Bucket
run: |
if aws s3api head-bucket --bucket pr-preview-bioconductor-pr${{github.event.number}} 2>/dev/null; then
aws s3 rm s3://pr-preview-bioconductor-pr${{github.event.number}} --recursive
echo "BUCKET_EXISTS=true" >> "$GITHUB_ENV"
else
echo "Bucket does not exist"
echo "BUCKET_EXISTS=false" >> "$GITHUB_ENV"
fi
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-east-1"
- name: Delete Website Bucket
if: ${{env.BUCKET_EXISTS == 'true'}}
uses: danburtenshaw/[email protected]
with:
bucket-prefix: "pr-preview-bioconductor"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}