Merge pull request #35 from imclerran/update-docs #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate docs | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
generate-docs: | |
name: Generate docs | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Check out the repository | |
uses: actions/[email protected] | |
- name: Install Roc | |
uses: hasnep/[email protected] | |
with: | |
roc-version: nightly | |
- name: Generate docs | |
run: roc docs package/main.roc | |
- name: List contents of generated-docs directory (before fix paths) | |
run: ls -R generated-docs | |
- name: Fix absolute paths | |
run: | | |
find generated-docs/ -type f -name '*.html' -exec sed -i "s/\(href\|src\)=\"\//\1=\"\/${{ github.event.repository.name }}\//g" {} + | |
- name: List contents of generated-docs directory (after fix paths) | |
run: ls -R generated-docs | |
- name: Upload docs artifact | |
uses: actions/[email protected] | |
with: | |
path: generated-docs | |
- name: Deploy docs | |
uses: actions/[email protected] | |
environment: | |
name: github-pages |