tools/corrosion/.github/workflows/gh-pages.yaml
branchtransitional_engine
changeset 16067 d903f8d2395a
parent 16050 6a3dc15b78b9
--- a/tools/corrosion/.github/workflows/gh-pages.yaml	Wed Sep 18 14:10:51 2024 +0200
+++ b/tools/corrosion/.github/workflows/gh-pages.yaml	Wed Nov 20 21:37:47 2024 +0100
@@ -18,15 +18,13 @@
   cancel-in-progress: true
 
 jobs:
+  # Build and deploy the documentation of master and the stable/v0.5 branch
   deploy:
     runs-on: ubuntu-latest
     environment:
       name: github-pages
       url: ${{ steps.deployment.outputs.page_url }}
     steps:
-      - uses: actions/checkout@v4
-      - name: Setup Pages
-        uses: actions/configure-pages@v3
       - name: Install mdbook
         env:
           MDBOOK_VERSION: 'v0.4.27'
@@ -34,10 +32,23 @@
           mkdir mdbook
           curl -sSL https://github.com/rust-lang/mdBook/releases/download/${MDBOOK_VERSION}/mdbook-${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
           echo `pwd`/mdbook >> $GITHUB_PATH
-      - name: Build mdbook
-        run: |
-          cd doc
-          mdbook build
+      - name: Checkout master
+        uses: actions/checkout@v4
+        with:
+          path: main
+      - name: Checkout stable/v0.5
+        uses: actions/checkout@v4
+        with:
+          path: stable-v0.5
+          ref: 'stable/v0.5'
+      - name: Setup Pages
+        uses: actions/configure-pages@v3
+      - name: Build mdbook for main branch
+        working-directory: 'main/doc'
+        run: mdbook build
+      - name: Build mdbook for stable/v0.5 branch
+        working-directory: 'stable-v0.5/doc'
+        run: mdbook build
       # Override mdbooks default highlight.js with a custom version containing CMake support.
       - uses: actions/checkout@v4
         with:
@@ -52,11 +63,16 @@
         working-directory: highlightjs
       - name: Override highlightjs
         run: |
-          cp highlightjs/build/highlight.min.js doc/book/highlight.js
+          cp highlightjs/build/highlight.min.js main/doc/book/highlight.js
+          cp highlightjs/build/highlight.min.js stable-v0.5/doc/book/highlight.js
+      - name: Copy stable doc into main
+        run: mkdir main/doc/book/v0.5 && cp -a stable-v0.5/doc/book/. main/doc/book/v0.5/
+      - name: Debug print
+        run: ls -la main/doc/book/v0.5
       - name: Upload artifact
-        uses: actions/upload-pages-artifact@v1
+        uses: actions/upload-pages-artifact@v2
         with:
-          path: 'doc/book'
+          path: 'main/doc/book'
       - name: Deploy to GitHub Pages
         id: deployment
-        uses: actions/deploy-pages@v1
+        uses: actions/deploy-pages@v2