Add questions #249
This file contains hidden or 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
| # Sample workflow for building and deploying a mdBook site to GitHub Pages | |
| # | |
| # To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html | |
| # | |
| name: Deploy | |
| on: | |
| # Runs on pushes targeting the default branch | |
| push: | |
| branches: | |
| - main | |
| - 'ss*' | |
| - 'ws*' | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| MDBOOK_VERSION: 0.4.40 | |
| steps: | |
| # get the source code | |
| - uses: actions/checkout@v4 | |
| # set the site-url for mdBook | |
| - name: Set mdBook site-url | |
| env: | |
| REPO_NAME: ${{ github.event.repository.name }} | |
| run: | | |
| if [ "${{ github.ref_name }}" = "main" ]; then | |
| echo "MDBOOK_OUTPUT__HTML__SITE_URL=/${REPO_NAME}/" >> "$GITHUB_ENV" | |
| else | |
| echo "MDBOOK_OUTPUT__HTML__SITE_URL=/${REPO_NAME}/${{ github.ref_name }}/" >> "$GITHUB_ENV" | |
| fi | |
| # install mdBook and preprocessors | |
| - name: Install mdBook | |
| run: | | |
| curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh | |
| rustup update | |
| cargo install --version ${MDBOOK_VERSION} mdbook | |
| - name: Install mdBook preprocessors | |
| run: | | |
| cargo install mdbook-admonish --locked --version 1.16.0 | |
| mdbook-admonish install . | |
| cargo install mdbook-katex --locked --version 0.9.0 | |
| cargo install mdbook-numeq --locked --version 0.3.0 | |
| cargo install mdbook-chapter-zero --locked --version 0.1.0 | |
| # build the book | |
| - name: Build with mdBook | |
| run: mdbook build | |
| # deploy main branch | |
| - name: Deploy main branch | |
| if: github.ref_name == 'main' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: book | |
| clean: true | |
| clean-exclude: | | |
| ss* | |
| ws* | |
| # deploy archive branche | |
| - name: Deploy archive branches | |
| if: github.ref_name != 'main' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: book | |
| target-folder: ${{ github.ref_name }} | |
| clean: true | |