Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit 69f69fb

Browse files
committed
adding docs delete action
1 parent dee1ce9 commit 69f69fb

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/docs_clean.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Docs Cleanup CI
2+
3+
# delete branch documentation when a branch is deleted
4+
# also allow manually deleting a documentation version
5+
on:
6+
delete:
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: "documentation version"
11+
required: true
12+
type: string
13+
14+
jobs:
15+
remove:
16+
if: github.event.ref_type == 'branch' || github.event_name == 'workflow_dispatch'
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: checkout
21+
uses: actions/checkout@v2
22+
with:
23+
branch: gh-pages
24+
25+
- name: removing documentation for branch ${{ github.event.ref }}
26+
if: ${{ github.event_name != 'workflow_dispatch' }}
27+
run: echo rm -r .github/pages/${{ github.event.ref }}
28+
29+
- name: manually removing documentation version ${{ github.event.inputs.version }}
30+
if: ${{ github.event_name == 'workflow_dispatch' }}
31+
run: echo rm -r .github/pages/${{ github.event.inputs.version }}

0 commit comments

Comments
 (0)