Skip to content

Commit

Permalink
Merge pull request #44 from fraya/divide-gh-doc-action
Browse files Browse the repository at this point in the history
ci: Divide build and check documentation from deploy
  • Loading branch information
fraya committed Jun 10, 2024
2 parents 413410e + ca06c5c commit 0f79f6f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
56 changes: 56 additions & 0 deletions .github/workflows/build-and-check-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build and check documentation

on:
pull_request:
# all branches
paths:
- 'documentation/**'

# This enables the Run Workflow button on the Actions tab.
workflow_dispatch:

# https://github.com/JamesIves/github-pages-deploy-action#readme
permissions:
contents: write

# Set DYLAN environment variable to GITHUB_WORKSPACE so packages are
# installed in ../../_packages relative to documentation's Makefile
env:
DYLAN: ${{ github.workspace }}

jobs:

build-and-deploy:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v4

- name: Check links
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/fraya/dylan-docs
options: -v ${{ github.workspace }}/documentation:/docs
run: make linkcheck

- name: Build docs with Furo theme
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/fraya/dylan-docs
options: -v ${{ github.workspace }}/documentation:/docs
run: make html

- name: Upload html artifact
uses: actions/upload-artifact@v4
with:
name: command-line-parser
path: documentation/build/html/

- name: Bypassing Jekyll on GH Pages
run: sudo touch documentation/build/html/.nojekyll

- name: Deploy docs to GH pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: documentation/build/html
3 changes: 2 additions & 1 deletion .github/workflows/build-and-deploy-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Build and deploy documentation
on:
push:
# all branches
pull_request:
paths:
- 'documentation/**'

# This enables the Run Workflow button on the Actions tab.
workflow_dispatch:
Expand Down

0 comments on commit 0f79f6f

Please sign in to comment.