Prince 15.4 Documentation #30
Workflow file for this run
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: Build and deploy the Prince documentation site | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build-docs: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Install xsltproc | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y xsltproc | |
- name: Make the properties | |
run: | | |
cd ./website/properties | |
mkdir ./output | |
xsltproc table.xsl properties.xml > output/css-props.xml | |
chmod +x ./docs-process.py | |
chmod +x ./docs_selflink.py | |
./docs-process.py output/css-props-out.xml output/css-props.xml | |
./docs_selflink.py output/css-props-out.xml | |
xsltproc noroot.xsl output/css-props-out.xml > output/css-props.md | |
sed -i '1s;^;---\ntitle: CSS Properties\n---\n\n<style>\n.navigationSlider .slidingNav ul li:nth-child(3), .navigationSlider .slidingNav ul li:nth-child(3) > a:hover, .navigationSlider .slidingNav ul li.siteNavGroupActive > a { background-color: #fff }\n .nav-site li:nth-child(3) a { color: #333 !important }\n .nav-site li:nth-child(3) a:hover { color: #22b573 !important }\n </style>;' output/css-props.md | |
cat script >> output/css-props.md | |
cp output/css-props.md ../../docs/ | |
rm -rf ./output | |
cd ./../.. | |
shell: bash | |
- name: Install Prince | |
run: | | |
curl https://www.princexml.com/download/prince_15.3-1_ubuntu22.04_amd64.deb -O | |
sudo apt install ./prince_15.3-1_ubuntu22.04_amd64.deb | |
- name: Make the page region image | |
run: | | |
cd ./website/samples | |
prince marginboxes.html --raster-output marginboxes-1.full.png --raster-dpi=150 --raster-pages=1 --raster-format=png | |
convert marginboxes-1.full.png -resize 421x marginboxes-1.colour.png | |
cp marginboxes-1.colour.png ../../docs/assets/samples/ | |
cd ./../.. | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Build Docusaurus Docs | |
run: | | |
cd website | |
npm install | |
npm run build | |
- name: Prepare deployment | |
run: | | |
cd ./website/build/prince-docs | |
rm sitemap.xml doc/*.html | |
mv ./index.html ./doc/ | |
mv doc/doc-install doc/doc-prince doc/doc-refs ./ | |
cd ./../../.. | |
- name: Deploy | |
uses: nogsantos/ssh-scp-deploy@master | |
with: | |
src: ./website/build/prince-docs/* | |
host: ${{ secrets.SSH_HOST }} | |
remote: ${{ secrets.WEB_ROOT }} | |
port: ${{ secrets.SSH_PORT }} | |
user: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_KEY }} |