Document how to set up eugene in CI/CD #69
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy documentation to pages | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Build mdbook docs | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz \ | |
| tar -xvz | |
chmod +x mdbook | |
git branch -D doc-pages || true | |
mv eugene/docs . | |
./mdbook build docs | |
git checkout -b doc-pages | |
git add -f docs/book | |
git config user.name "mdbook docs bot" | |
git config user.email "kaaveland@gmail.com" | |
git config core.autocrlf false | |
git commit -m 'Build mdbook docs' | |
git push --force origin doc-pages | |
- name: Upload docs | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./docs/book | |
deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |