forked from SkriptLang/Skript
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.6 KB
/
cleanup-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Cleanup nightly documentation
on: delete
jobs:
cleanup-nightly-docs:
if: github.event.ref_type == 'branch'
runs-on: ubuntu-latest
steps:
- name: Configure workflow
id: configuration
env:
DELETED_BRANCH: ${{ github.event.ref }}
run: |
BRANCH_NAME="${DELETED_BRANCH#refs/*/}"
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT
echo "DOCS_OUTPUT_DIR=${GITHUB_WORKSPACE}/skript-docs/docs/nightly/${BRANCH_NAME}" >> $GITHUB_OUTPUT
echo "DOCS_REPO_DIR=${GITHUB_WORKSPACE}/skript-docs" >> $GITHUB_OUTPUT
- name: Checkout Skript
uses: actions/checkout@v3
with:
ref: ${{ github.event.repository.default_branch }}
submodules: recursive
path: skript
- name: Setup documentation environment
uses: ./skript/.github/workflows/docs/setup-docs
with:
docs_deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }}
docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
- name: Cleanup nightly documentation
env:
DOCS_OUTPUT_DIR: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }}
run: |
rm -rf ${DOCS_OUTPUT_DIR} || true
- name: Push nightly documentation cleanup
uses: ./skript/.github/workflows/docs/push-docs
with:
docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }}
git_name: Nightly Docs Bot
git_email: [email protected]
git_commit_message: "Delete ${{ steps.configuration.outputs.BRANCH_NAME }} branch nightly docs"