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

Commit 389333d

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

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
jobs:
88
docs:
9+
if: github.event_name != 'pull_request' || github.event.pull_request.repository == github.repository
910
strategy:
1011
fail-fast: false
1112
matrix:

.github/workflows/docs_clean.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88
inputs:
99
version:
10-
description: "documentation version"
10+
description: "documentation version to DELETE"
1111
required: true
1212
type: string
1313

@@ -20,12 +20,22 @@ jobs:
2020
- name: checkout
2121
uses: actions/checkout@v2
2222
with:
23-
branch: gh-pages
23+
ref: gh-pages
2424

2525
- name: removing documentation for branch ${{ github.event.ref }}
2626
if: ${{ github.event_name != 'workflow_dispatch' }}
27-
run: echo rm -r .github/pages/${{ github.event.ref }}
27+
run: echo "remove_me=${{ github.event.ref }}" >> $GITHUB_ENV
2828

2929
- name: manually removing documentation version ${{ github.event.inputs.version }}
3030
if: ${{ github.event_name == 'workflow_dispatch' }}
31-
run: echo rm -r .github/pages/${{ github.event.inputs.version }}
31+
run: echo "remove_me=${{ github.event.inputs.version }}" >> $GITHUB_ENV
32+
33+
- name: update index and push changes
34+
run: |
35+
echo removing redundant documentation version ${{ env.remove_me }}
36+
rm -r ${{ env.remove_me }}
37+
sed -i /${{ env.remove_me }}/d versions.txt
38+
git config --global user.name 'GitHub Actions Docs Cleanup CI'
39+
git config --global user.email '[email protected]'
40+
git commit -am"removing redundant docs version ${{ env.remove_me }}"
41+
git push

0 commit comments

Comments
 (0)