diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index f2b577ef4..416cfb20b 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -1,82 +1,45 @@ -name: Generate Documentation +name: Doc on: push: branches: - main - # only match branches that look like Minecraft versions - - "*.*" workflow_dispatch: + permissions: contents: write + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true jobs: deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v3 - - - name: Install Rust Toolchain - uses: rs-workspace/rust-toolchain@v0.1.0 + - uses: actions-rs/toolchain@v1 with: toolchain: nightly - - - name: Generate Documentation - run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo doc --workspace --no-deps - - - name: Prepare Documentation - run: | - BRANCH_NAME=$(echo "${GITHUB_REF##*/}" | tr '/' '_') # Get branch name safely - mkdir -p versioned_docs/$BRANCH_NAME - cp -r target/doc/* versioned_docs/$BRANCH_NAME - - - name: Checkout to Docs Branch - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git fetch origin docs || git checkout --orphan docs - git checkout docs - cp -r versioned_docs/* ./ # Copy docs to branch root - rm -rf versioned_docs # Clean up - rm -rf target # Clean up - - - name: Generate branches.html - run: | - VERSIONS=$(ls -d */ | sed 's#/##' | sort -r) # Get all version directories and sort them (latest first) - echo "" > branches.html - echo "" >> branches.html - echo "
" >> branches.html - echo " " >> branches.html - echo " " >> branches.html - echo "Welcome to the documentation for Azalea.
" >> branches.html - echo "