LP1903476: Use Github Actions to build antora documentation
authorJane Sandberg <sandbej@linnbenton.edu>
Wed, 27 Oct 2021 17:16:30 +0000 (10:16 -0700)
committerJason Boyer <JBoyer@equinoxOLI.org>
Wed, 12 Jan 2022 12:10:49 +0000 (07:10 -0500)
This allows documenters to submit a pull request and get a
preview version where they can view their changes.  The goal
is to provide quick feedback to documenters on whether their
changes build correctly and appear as desired, without them
having to have a full docs building setup locally.

To test:
1. Use the Github Web site to fork the Evergreen repository.
2. Take the .github/workflows/docs.yml file from this commit.
Add it to any branch of your fork of the Evergreen repository.
3. Click on the Actions tab of your fork in the Github Web
4. Click on the most recent run (at the top of the list).
5. When the build process is done (should take 3-4 minutes),
download and unzip the artifact that appears at the bottom of
the screen.  Open index.html in your browser.  Confirm that
the docs built properly.
6. On the same branch, make some changes to the documentation
in the docs/modules directory.
7. Repeat steps 3-5.  Confirm that your changes are reflected
in the new artifact.

Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org>
.github/workflows/docs.yml [new file with mode: 0644]

diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644 (file)
index 0000000..0d41f03
--- /dev/null
@@ -0,0 +1,18 @@
+name: docs
+on: [push, pull_request]
+  Build-And-Publish-Docs:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: shogo82148/actions-setup-perl@v1
+        with:
+          perl-version: '5.34'
+      - run: |
+          cd docs
+          sed -i 's/branches.*/branches: [HEAD]/' site.yml
+          perl generate_docs.pl --base-url http://example.com
+      - uses: actions/upload-artifact@v2
+        with:
+          name: built-docs
+          path: docs/output