Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Github] Attempt to auto-clean a PR deployment on merge/close #320

Merged
merged 1 commit into from May 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/clean_pr_preview.yaml
@@ -0,0 +1,40 @@
name: Clean PR preview

on:
pull_request:
types: [ closed ]

jobs:

deploy-pr:
name: '馃Ч Clean PR preview'
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
ref: gh-pages

- name: 'Remove PR folder if it exists'
run: rm -Rf pr/${{ github.event.number }}

- name: 'Git status'
run: git status

# https://github.com/EndBug/add-and-commit
- name: 'Commit & push changes'
uses: EndBug/add-and-commit@v4
with:
author_name: GitHub Actions Bot
author_email: actions@github.com
COMMIT_MESSAGE: |
[AUTO] Removed deployment for PR #${{ github.event.number }}
for commit ${{ github.sha }}
add: "./pr/"
ref: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}