]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Update FreeRADIUS web site Antora documentation
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 26 Jul 2023 15:11:56 +0000 (16:11 +0100)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 26 Jul 2023 21:40:40 +0000 (22:40 +0100)
.github/workflows/documentation.yml
doc/antora/main-site.yml.in [new file with mode: 0644]

index 1ab66e9a1af33c478586bea9969f1057b04a5b9f..72129671d2c3c63498da56f8a9ee6e7080406bd7 100644 (file)
@@ -29,6 +29,8 @@ jobs:
 
     steps:
     - uses: actions/checkout@v3
+      with:
+        fetch-depth: 0
 
     - name: Install common build dependencies
       run: |
@@ -56,7 +58,10 @@ jobs:
          doxygen Doxyfile;
 
     - name: Build Antora docsite
-      run: antora site.yml
+      run: |
+        LATEST_RELEASE=$(git tag -l 'release_3_2*' | sort | tail -1 | sed -e 's/release_//' -e 's/_/\./g')
+        sed -e "s/%LATEST%/$LATEST_RELEASE/" doc/antora/main-site.yml.in > main-site.yml
+        antora --to-dir build/docsite main-site.yml
 
     - name: Tar output files
       run: tar -czf site.tgz doc/doxygen/html build/docsite
@@ -69,7 +74,7 @@ jobs:
         retention-days: 1
 
   # Actual deployment to GitHub Pages is only on pushes to the head of the master branch
-  deploy-docs:
+  deploy-doxygen-docs:
     if: ( github.repository_owner == 'FreeRADIUS' ) && ( github.ref == 'refs/heads/master' ) && ( github.event_name == 'push' )
 
     needs:
@@ -115,3 +120,66 @@ jobs:
     - name: Deploy doxygen content to GitHub pages
       id: deployment
       uses: actions/deploy-pages@v1
+
+  deploy-antora-docs:
+    if: ( github.repository_owner == 'FreeRADIUS' ) && ( github.ref == 'refs/heads/master' ) && ( github.event_name == 'push' )
+
+    needs:
+      - build-docs
+
+    runs-on: ubuntu-latest
+
+    strategy:
+      fail-fast: true
+
+    # Ensure only one job is attempting to update the docs repo
+    concurrency:
+      group: "antora-documentation"
+      cancel-in-progress: true
+
+    steps:
+    - name: Setup SSH for git access
+      uses: shimataro/ssh-key-action@v2
+      with:
+        key: ${{ secrets.NR_GIT_SSH_GITHUBACTIONS_KEY }}
+        name: id_rsa-git
+        known_hosts: ${{ secrets.NR_GIT_SSH_KNOWN_HOSTS }}
+        config: |
+          Host git.networkradius.com
+            User git
+            IdentityFile ~/.ssh/id_rsa-git
+
+    - name: Retrieve output
+      uses: actions/download-artifact@v3
+      with:
+        name: compiled-docs
+
+    - name: Extract sites
+      run: tar -zxf site.tgz
+
+    - name: Checkout doc repository
+      run: |
+        git config --global user.email "git@github.com"
+        git config --global user.name "Github Actions"
+        git clone -b master git@git.networkradius.com:www.freeradius.org-docs www.freeradius.org-docs
+
+    - name: Remove existing web site from repo
+      run: |
+        cd www.freeradius.org-docs
+        git ls-files -moc | grep -v ._antora_docs_repo | xargs -r git rm
+
+    - name: Copy new web site to repo
+      run: |
+        rsync -av build/docsite/ www.freeradius.org-docs/
+
+    - name: Commit new web site files
+      run: |
+        cd www.freeradius.org-docs
+        rm -f sitemap*.xml
+        git ls-files -o | xargs -r git add
+        git commit -q -m "Github Actions auto commit $(date)" || true
+
+    - name: Push doc repository
+      run: |
+        cd www.freeradius.org-docs
+        git push origin
diff --git a/doc/antora/main-site.yml.in b/doc/antora/main-site.yml.in
new file mode 100644 (file)
index 0000000..4cacdad
--- /dev/null
@@ -0,0 +1,49 @@
+#
+#  Used by the GitHub Actions "Documentation" job to build
+#  the FreeRADIUS web site docuementation on each push. To
+#  generate the site locally use 'make docsite' in the top
+#  level directory, not this file.
+#
+
+site:
+  title: The FreeRADIUS project - Documentation
+  url: https://freeradius.org/docs
+  start_page: %LATEST%@freeradius-server:ROOT:index.adoc
+
+content:
+  sources:
+  - url: .
+    branches:
+# latest v4 tree
+      - HEAD
+# latest v3.0 dev branch HEAD
+      - v3.0.x
+# don't include latest v3.2 dev branch HEAD (releases are below)
+#      - v3.2.x
+    tags:
+# don't include all v3.0 releases, antora complains as most don't
+# include any antora documentation
+      - "release_3_0_*"
+      - "!release_3_0_*_*"
+      - "!release_3_0_?"
+      - "!release_3_0_1?"
+      - "!release_3_0_20"
+      - "!release_3_0_21"
+# all v3.2 releases
+      - "release_3_2_*"
+# for future v4 releases
+#      - "release_4_*"
+    start_path: doc/antora
+
+asciidoc:
+  attributes:
+    attribute-missing: skip
+
+ui:
+  bundle:
+    url: https://github.com/FreeRADIUS/freeradius-docs-ui/blob/master-releases/ui-bundle.zip?raw=true
+    snapshot: true
+  default_layout: freeradiusorg
+
+output:
+  clean: true