Browse Source

Merge pull request #4537 from Calinou/ci-html-zip-download

GitHub Actions: Upload ZIPs of compiled HTML documentation for reading
Rémi Verschelde 4 years ago
parent
commit
b46c6b439a
1 changed files with 23 additions and 3 deletions
  1. 23 3
      .github/workflows/ci.yml

+ 23 - 3
.github/workflows/ci.yml

@@ -1,5 +1,11 @@
 name: Continuous integration
 name: Continuous integration
-on: [push, pull_request]
+on:
+  push:
+  pull_request:
+  schedule:
+    # Every week on Monday at midnight (UTC).
+    # This keeps the generated HTML documentation fresh.
+    - cron: '0 0 * * 1'
 
 
 jobs:
 jobs:
   build:
   build:
@@ -17,11 +23,25 @@ jobs:
           sudo pip3 install codespell
           sudo pip3 install codespell
 
 
       - name: Linter checks
       - name: Linter checks
+        if: github.event_name != 'schedule'
         run: |
         run: |
           bash _tools/format.sh
           bash _tools/format.sh
           codespell -I _tools/codespell-ignore.txt -x _tools/codespell-ignore-lines.txt {about,community,development,getting_started,tutorials}/**/*.rst
           codespell -I _tools/codespell-ignore.txt -x _tools/codespell-ignore-lines.txt {about,community,development,getting_started,tutorials}/**/*.rst
 
 
       - name: Sphinx build
       - name: Sphinx build
         run: |
         run: |
-          # Use dummy builder to improve performance.
-          sphinx-build --color -b dummy -d _build/doctrees -W . _build/html
+          if [[ "$GITHUB_EVENT_NAME" == "schedule" ]]; then
+            # Build HTML to upload it.
+            sphinx-build --color -d _build/doctrees -W . _build/html
+          else
+            # Use dummy builder to improve performance.
+            sphinx-build --color -b dummy -d _build/doctrees -W . _build/html
+          fi
+
+      - uses: actions/upload-artifact@v2
+        if: github.event_name == 'schedule'
+        with:
+          name: godot-docs-html
+          path: _build/html
+          # Keep the current build and the previous build (in case a scheduled build failed).
+          retention-days: 15