1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
name: "Generate API doc and publish to GitHub Pages"
on:
# workflow_dispatch event is a manual run
workflow_dispatch:
push:
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'test/**'
- '.github/workflows/test*'
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'test/**'
- '.github/workflows/test*'
# This allows a subsequently queued workflow run to interrupt previous runs.
# github.workflow is the name of the workflow.
# If the workflow file doesn't specify a name,
# the value of this property is the full path of the workflow
# file in the repository.
# github.head_ref is source branch of a pull_request
# github.ref The fully-formed ref of the branch or tag that triggered the workflow run.
# For workflows triggered by push, this is the branch or tag ref that was pushed.
# For workflows triggered by pull_request, this is the pull request merge branch.
# ...
# For workflow_dispatch this is the branch or tag ref that triggered the workflow run.
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
build-api-doc:
runs-on: ubuntu-latest
steps:
- name: Print debug info header
run: |
echo concurrency group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
echo github.workflow: ${{ github.workflow }}
echo github.event_name: ${{ github.event_name }}
echo github.event.pull_request.head.label: ${{ github.event.pull_request.head.label }}
echo github.head_ref: ${{ github.head_ref }}
echo github.ref: ${{ github.ref }}
echo github.ref_name: ${{ github.ref_name }}
- name: Check out repository code
uses: actions/checkout@v3
with:
path: ${{ github.workspace }}/docker-home/cl-plus-ssl
- name: Check out package-doc-dump # (since it's not in Quicklisp yet)
uses: actions/checkout@v3
with:
repository: avodonosov/package-doc-dump
ref: master
path: ${{ github.workspace }}/docker-home/package-doc-dump
- name: Check out browsable-colorize # (since it's not in Quicklisp yet)
uses: actions/checkout@v3
with:
repository: avodonosov/browsable-colorize
ref: master
path: ${{ github.workspace }}/docker-home/browsable-colorize
- name: List files in the repository
run: |
pwd
ls ${{ github.workspace }}/docker-home/
- name: Ask the clfoundation/cl-devel docker image to fill the directory we mount to it as /home/cl with default config (init files for lisps, quiclisp, etc)
run: |
docker run -u "$(id -u):$(id -g)" -i --mount type=bind,source=${{ github.workspace }}/docker-home,target=/home/cl/ clfoundation/cl-devel:2022-02-09 unpack-default-home-dir
- name: run package-doc-dump
run: |
docker run -u "$(id -u):$(id -g)" -i --mount type=bind,source=${{ github.workspace }}/docker-home,target=/home/cl/ clfoundation/cl-devel:2022-02-09 -q ccl --batch --load /home/cl/cl-plus-ssl/.github/workflows/api-doc.lisp
- name: Update quicklisp (needed for fixed "colorize" version)
run: |
docker run -u "$(id -u):$(id -g)" -i --mount type=bind,source=${{ github.workspace }}/docker-home,target=/home/cl/ clfoundation/cl-devel:2022-02-09 -q ccl --batch --eval '(ql-dist:install-dist "http://beta.quicklisp.org/dist/quicklisp/2023-02-15/distinfo.txt" :replace t :prompt nil)'
- name: run browsable-colorize
run: |
docker run -u "$(id -u):$(id -g)" -i --mount type=bind,source=${{ github.workspace }}/docker-home,target=/home/cl/ clfoundation/cl-devel:2022-02-09 -q ccl --batch --load /home/cl/cl-plus-ssl/.github/workflows/browsable-package-files.lisp
- name: List files in the repository
run: |
pwd
ls ${{ github.workspace }}/docker-home/
- name: prepare GitHub Pages content directory
run: |
mkdir ${{ github.workspace }}/github-pages/
# package-doc-dump results
cp ${{ github.workspace }}/docker-home/cl-plus-ssl-api.html ${{ github.workspace }}/github-pages/
# browsable-colorize results
cp ${{ github.workspace }}/docker-home/cl-plus-ssl/src/package.html ${{ github.workspace }}/github-pages/
cp ${{ github.workspace }}/docker-home/cl-plus-ssl/src/config.html ${{ github.workspace }}/github-pages/
# the legacy index.html
cp ${{ github.workspace }}/docker-home/cl-plus-ssl/index.html ${{ github.workspace }}/github-pages/
cp ${{ github.workspace }}/docker-home/cl-plus-ssl/index.css ${{ github.workspace }}/github-pages/
- name: Package and upload GitHub Pages artifact
if: |
'master' == github.ref_name
&& ( 'workflow_dispatch' == github.event_name
|| 'push' == github.event_name )
uses: actions/upload-pages-artifact@v1
with:
path: ${{ github.workspace }}/github-pages
deploy:
if: |
'master' == github.ref_name
&& ( 'workflow_dispatch' == github.event_name
|| 'push' == github.event_name )
# Additionally protected by the deployment environment.
# GitHub will automatically create a deployment
# environment with the specified name, if not
# exists already, and only the master branch will
# have access to it by default.
# (Can be managed in the Settings / Environments
# of the repo)
environment:
name: github-pages
# Display the resulting GitHub Pages URL at this
# job box in the visualization graph for the workflow run
url: ${{ steps.deployment.outputs.page_url }}cl-plus-ssl-api.html
runs-on: ubuntu-latest
needs: build-api-doc
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
|