Skip to content

Commit

Permalink
Destroy history of github-pages branch (#3783)
Browse files Browse the repository at this point in the history
## Motivation and Context

Keeping the history of `github-pages` is not useful, and it hogs the
output of `git log --graph --all` and other such views of the repository
history. In the event that someone would need to look at old contents of
the website, it can be regenerated using `mdbook` from any commit on
`main`.

<img
src="https://github.com/user-attachments/assets/f37630fa-92ef-4e49-a9e5-a1357a785e46"
width="550">

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
  • Loading branch information
dtolnay authored Aug 7, 2024
1 parent c0f8173 commit 1ee932f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@ jobs:
git config --local user.name "AWS SDK Rust Bot"
git config --local user.email "[email protected]"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
git fetch origin github-pages
REV=$(git rev-parse --short HEAD)
pushd design &>/dev/null
cargo install mdbook
cargo install --locked mdbook-mermaid
mdbook build --dest-dir ../../output
popd &>/dev/null
git checkout origin/github-pages -b github-pages
rm -rf design
git checkout --orphan github-pages
git rm --cached -r .
git clean -ffdx
mv ../output design
git add design
git commit -m "Update design docs"
git push origin github-pages
git commit -m "Design docs @ ${{ github.repository }}@${REV}"
git push origin github-pages --force

0 comments on commit 1ee932f

Please sign in to comment.