Skip to content

Commit 55d1ae2

Browse files
committed
revert doc updates
1 parent 9e98ab3 commit 55d1ae2

File tree

2 files changed

+27
-65
lines changed

2 files changed

+27
-65
lines changed

.github/workflows/doc.yml

Lines changed: 27 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,45 @@
1-
name: Generate Documentation
1+
name: Doc
22

33
on:
44
push:
55
branches:
66
- main
7-
# only match branches that look like Minecraft versions
8-
- "*.*"
97
workflow_dispatch:
108

9+
1110
permissions:
1211
contents: write
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: true
1318

1419
jobs:
1520
deploy:
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
1624
runs-on: ubuntu-latest
1725
steps:
1826
- name: Checkout Repository
1927
uses: actions/checkout@v3
20-
21-
- name: Install Rust Toolchain
22-
uses: rs-workspace/rust-toolchain@v0.1.0
28+
- uses: actions-rs/toolchain@v1
2329
with:
2430
toolchain: nightly
25-
26-
- name: Generate Documentation
27-
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo doc --workspace --no-deps
28-
29-
- name: Prepare Documentation
30-
run: |
31-
BRANCH_NAME=$(echo "${GITHUB_REF##*/}" | tr '/' '_') # Get branch name safely
32-
mkdir -p versioned_docs/$BRANCH_NAME
33-
cp -r target/doc/* versioned_docs/$BRANCH_NAME
34-
35-
- name: Checkout to Docs Branch
36-
run: |
37-
git config --global user.name "github-actions[bot]"
38-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
39-
git fetch origin docs || git checkout --orphan docs
40-
git checkout docs
41-
cp -r versioned_docs/* ./ # Copy docs to branch root
42-
rm -rf versioned_docs # Clean up
43-
rm -rf target # Clean up
44-
45-
- name: Generate branches.html
46-
run: |
47-
VERSIONS=$(ls -d */ | sed 's#/##' | sort -r) # Get all version directories and sort them (latest first)
48-
echo "<!DOCTYPE html>" > branches.html
49-
echo "<html lang=\"en\">" >> branches.html
50-
echo "<head>" >> branches.html
51-
echo " <meta charset=\"UTF-8\">" >> branches.html
52-
echo " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">" >> branches.html
53-
echo " <title>Azalea Docs</title>" >> branches.html
54-
echo "</head>" >> branches.html
55-
echo "<body>" >> branches.html
56-
echo " <h1>Azalea Docs</h1>" >> branches.html
57-
echo " <p>Welcome to the documentation for Azalea.</p>" >> branches.html
58-
echo " <h2>Available Versions</h2>" >> branches.html
59-
echo " <ul>" >> branches.html
60-
61-
# Update branches.html with available versions
62-
for VERSION in $VERSIONS; do
63-
echo " <li><a href=\"https://azalea.matdoes.dev/$VERSION/index.html\">$VERSION</a></li>" >> branches.html
64-
done
65-
66-
echo " </ul>" >> branches.html
67-
echo "</body>" >> branches.html
68-
echo "</html>" >> branches.html
69-
70-
echo "branches.html generated successfully."
71-
72-
- name: Create Index Page
73-
run: |
74-
if [ ! -f index.html ]; then
75-
echo "<meta http-equiv=refresh content=0;url=main/azalea>" > index.html
76-
fi
77-
78-
- name: Deploy Documentation to Docs Branch
79-
run: |
80-
git add .
81-
git commit -m "Update documentation for $GITHUB_REF_NAME" || echo "No changes to commit"
82-
git push origin docs
31+
- run: cargo doc --workspace --no-deps
32+
- uses: "finnp/create-file-action@master"
33+
env:
34+
FILE_NAME: "./target/doc/index.html"
35+
FILE_DATA: '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0;url=''./azalea''"/></head></html>' # Redirect to default page
36+
37+
- name: Setup Pages
38+
uses: actions/configure-pages@v2
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v1
41+
with:
42+
path: './target/doc/'
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v1

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)