1
0
Fork 0
forked from gitea/blog
blog/.gitea/workflows/delete_preview.yml
Lunny Xiao d0a6708d0a Delete PR s3 when PR closed (#262)
Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.io>
Reviewed-on: gitea/blog#262
Reviewed-by: delvh <dev.lh@web.de>
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-04-20 22:48:27 +08:00

20 lines
527 B
YAML

name: delete closed PR preview s3
on:
pull_request:
types: [closed]
env:
AWS_REGION: eu-central-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
jobs:
delete_preview:
runs-on: ubuntu-latest
steps:
- name: install aws cli
run: apt update -y && apt install -y awscli
- name: delete bucket
run: aws s3 rb s3://preview-gitea-org-${{ github.event.repository.name }}-${{ github.event.number }} --force || /bin/true