]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Rework documentation CI job 4921/head
authorNick Porter <nick@portercomputing.co.uk>
Thu, 9 Mar 2023 16:34:55 +0000 (16:34 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 9 Mar 2023 16:48:19 +0000 (16:48 +0000)
Split into two jobs, where the github publishing is only in the second.

.github/workflows/documentation.yml

index e69d593a3a8a8ef392c13376ecdc584ce8f90c28..2febdcd0f71dc5fa7e4e84b53b0d2ff8611ab2f8 100644 (file)
@@ -20,22 +20,8 @@ on:
       - 'raddb/**'
       - 'share/**'
 
-# Permissions needed to deploy on GitHub Pages
-permissions:
-  contents: read
-  pages: write
-  id-token: write
-
-# Ensure only one job is attempting to update GitHub Pages
-concurrency:
-  group: "documentation"
-  cancel-in-progress: true
-
 jobs:
-  documentation:
-    environment:
-      name: github-pages
-      url: ${{ steps.deployment.outputs.page_url }}
+  build-docs:
     runs-on: ubuntu-latest
 
     strategy:
@@ -66,21 +52,63 @@ jobs:
          cd doc/doxygen;
          doxygen Doxyfile;
 
-    # Actual deployment to GitHub Pages is only on pushes to the head of the master branch
+    - name: Build Antora docsite
+      run: antora site.yml
+
+    - name: Tar output files
+      run: tar -czf site.tgz doc/doxygen/html build/docsite
+
+    - name: Store output
+      uses: actions/upload-artifact@v3
+      with:
+        name: compiled-docs
+        path: site.tgz
+        retention-days: 1
+
+  # Actual deployment to GitHub Pages is only on pushes to the head of the master branch
+  deploy-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
+
+    # Permissions needed to deploy on GitHub Pages
+    permissions:
+      contents: read
+      pages: write
+      id-token: write
+
+    # Ensure only one job is attempting to update GitHub Pages
+    concurrency:
+      group: "documentation"
+      cancel-in-progress: true
+
+    environment:
+      name: github-pages
+      url: ${{ steps.deployment.outputs.page_url }}
+
+    steps:
+    - name: Retrieve output
+      uses: actions/download-artifacts@v3
+      with:
+        name: compiled-docs
+
+    - name: Extract sites
+      run: tar -zxf site.tgz
+
     - name: Setup Pages
-      if: ( github.repository.owner == 'FreeRADIUS' ) && ( github.ref == 'refs/heads/master' ) && ( github.event_name == 'push' )
       uses: actions/configure-pages@v3
 
     - name: Upload Doxygen content
-      if: ( github.repository_owner == 'FreeRADIUS' ) && ( github.ref == 'refs/heads/master' ) && ( github.event_name == 'push' )
       uses: actions/upload-pages-artifact@v1
       with:
         path: 'doc/doxygen/html'
 
     - name: Deploy doxygen content to GitHub pages
-      if: ( github.repository_owner == 'FreeRADIUS' ) && ( github.ref == 'refs/heads/master' ) && ( github.event_name == 'push' )
       id: deployment
       uses: actions/deploy-pages@v1
-
-    - name: Build Antora docsite
-      run: antora site.yml