publish #59
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: Publishing new site | |
on: [repository_dispatch] | |
permissions: | |
contents: write | |
jobs: | |
deploy-to-gh-pages: | |
name: Deploy spec site to github pages | |
if: github.event.action == 'publish' | |
runs-on: ubuntu-latest | |
environment: github-pages | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: wamp-proto/wamp-proto | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
path: wamp-proto | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- run: export PATH=$PATH:$HOME/.local/bin | |
- run: export WAMP_BUILD_ID="$(date -u "+%Y%m%d")-$(git rev-parse --short ${{ github.event.client_payload.commit_sha }})" | |
- run: sudo apt update | |
- run: sudo apt install -y xml2rfc libxml2-utils libenchant-2-2 enscript weasyprint libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0 python3-cffi python3-brotli | |
- run: pip install -r requirements.txt | |
working-directory: ./wamp-proto | |
- run: pip install 'weasyprint>=53.0' | |
- run: wget https://github.com/mmarkdown/mmark/releases/download/v2.2.25/mmark_2.2.25_linux_amd64.tgz | |
- run: tar xvzf mmark_2.2.25_linux_amd64.tgz | |
- run: rm -f ./mmark*.tgz | |
- run: sudo cp ./mmark /usr/local/bin/ | |
- run: make build | |
working-directory: ./wamp-proto | |
- run: mv ./wamp-proto/dist/_graphics ./wamp-proto/dist/graphics | |
- run: mv ./wamp-proto/dist/_images ./wamp-proto/dist/images | |
- run: mv ./wamp-proto/dist/_sources ./wamp-proto/dist/sources | |
- run: mv ./wamp-proto/dist/_static ./wamp-proto/dist/static | |
- name: Rename underscore urls in dist | |
run: find ./wamp-proto/dist -type f \( -name "*.html" -or -name "*.txt" \) -print -exec sed -i 's/_graphics\//graphics\//g' {} \; | |
- run: find ./wamp-proto/dist -type f \( -name "*.html" -or -name "*.txt" \) -print -exec sed -i 's/_images\//images\//g' {} \; | |
- run: find ./wamp-proto/dist -type f \( -name "*.html" -or -name "*.txt" \) -print -exec sed -i 's/_sources\//sources\//g' {} \; | |
- run: find ./wamp-proto/dist -type f \( -name "*.html" -or -name "*.txt" \) -print -exec sed -i 's/_static\//static\//g' {} \; | |
- run: rm -rf dist | |
- run: cp -r wamp-proto/dist ./ | |
- run: cp -r favicons/* dist/ | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: dist # The folder the action should deploy. |