ci: Remove docs preview when PR is closed

This commit is contained in:
Kévin Commaille 2022-06-20 13:38:01 +02:00 committed by Kévin Commaille
parent 1a36508806
commit 212596f9ba

27
.github/workflows/pr-closed.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: PR Closed
on:
pull_request:
branches: [main, next]
types: [closed]
jobs:
docs:
name: Remove Docs Preview
runs-on: ubuntu-latest
steps:
- name: Teardown
uses: adrianjost/actions-surge.sh-teardown@v1.0.3
with:
regex: pr-${{ github.event.number }}--ruma-docs.surge.sh
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
- name: Remove preview URL
uses: Beakyn/gha-comment-pull-request@v1.0.2
id: deploy-preview
env:
GITHUB_TOKEN: ${{ github.token }}
with:
description-message: Preview removed