From d5eea5ebcc0b76604eb7558ea80e6d44854c43ed Mon Sep 17 00:00:00 2001 From: xmiaocat Date: Thu, 8 May 2025 13:32:34 +0200 Subject: [PATCH 1/2] Add archive page --- .github/workflows/deploy.yml | 57 +++++++++++++++++++++--------------- src/SUMMARY.md | 2 +- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b389a1c..6d386ff 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,14 +7,17 @@ name: Deploy on: # Runs on pushes targeting the default branch push: - branches: ["main"] + 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: read + contents: write pages: write id-token: write @@ -25,13 +28,15 @@ concurrency: cancel-in-progress: false jobs: - # Build job - build: + build-and-deploy: runs-on: ubuntu-latest env: MDBOOK_VERSION: 0.4.37 steps: + # get the source code - uses: actions/checkout@v4 + + # install mdBook and preprocessors - name: Install mdBook run: | curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh @@ -44,26 +49,30 @@ jobs: cargo install mdbook-katex --locked --version 0.6.0 cargo install mdbook-numeq --locked --version 0.3.0 cargo install --git https://github.com/xmiaocat/mdbook-chapter-zero#e50441d - cargo install mdbook-shiftinclude --locked --version 0.1.0 - - name: Setup Pages - id: pages - uses: actions/configure-pages@v4 + + # build the book - name: Build with mdBook - run: | - mdbook build - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + run: mdbook build + + # deploy main branch + - name: Deploy main branch + if: github.ref_name == 'main' + uses: JamesIves/github-pages-deploy-action@v4 with: - path: ./book + 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 - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/src/SUMMARY.md b/src/SUMMARY.md index a8371b0..3804860 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -30,7 +30,7 @@ - [Harmonic Oscillator](02-symbolic_computation/04-harmonic_oscillator.md) - [Molecular Integrals](03-molecular_integrals.md) - - [Latest Scripts](03-molecular_integrals/00-latest_scripts.md) + - [Latest Scripts]() - [Gaussian Type Orbitals](03-molecular_integrals/01-gaussian_orbitals.md) - [Hermite Gaussians](03-molecular_integrals/02-hermite_gaussians.md) - [Overlap Integrals](03-molecular_integrals/03-overlap_integrals.md) From aaecd7a6846cb18e11f7780f26e1c98446275e2d Mon Sep 17 00:00:00 2001 From: xmiaocat Date: Thu, 8 May 2025 13:36:06 +0200 Subject: [PATCH 2/2] Add back the deleted preprocessor --- .github/workflows/deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6d386ff..e99d61f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -49,7 +49,8 @@ jobs: cargo install mdbook-katex --locked --version 0.6.0 cargo install mdbook-numeq --locked --version 0.3.0 cargo install --git https://github.com/xmiaocat/mdbook-chapter-zero#e50441d - + cargo install mdbook-shiftinclude --locked --version 0.1.0 + # build the book - name: Build with mdBook run: mdbook build