Skip to content

Cleanup nightly documentation #125

Cleanup nightly documentation

Cleanup nightly documentation #125

Workflow file for this run

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@v4
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"