mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
62 lines
1.9 KiB
YAML
62 lines
1.9 KiB
YAML
name: documentation preview
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'doc/**'
|
|
- 'scripts/build-docs.sh'
|
|
- '.github/workflows/docs-preview.yaml'
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
scripts:
|
|
name: build
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: 'staging.chatmail.at/doc/relay/'
|
|
url: https://staging.chatmail.at/doc/relay/${{ steps.prepare.outputs.prid }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: initenv
|
|
run: scripts/initenv.sh
|
|
|
|
- name: append venv/bin to PATH
|
|
run: echo `pwd`/venv/bin >>$GITHUB_PATH
|
|
|
|
- name: build documentation
|
|
working-directory: doc
|
|
run: sphinx-build source build
|
|
|
|
- name: build documentation second time (for TOC)
|
|
working-directory: doc
|
|
run: sphinx-build source build
|
|
|
|
- name: Get Pullrequest ID
|
|
id: prepare
|
|
run: |
|
|
export PULLREQUEST_ID=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
|
|
echo "prid=$PULLREQUEST_ID" >> $GITHUB_OUTPUT
|
|
if [ $(expr length "${{ secrets.USERNAME }}") -gt "1" ]; then echo "uploadtoserver=true" >> $GITHUB_OUTPUT; fi
|
|
- run: |
|
|
echo "baseurl: /${STEPS_PREPARE_OUTPUTS_PRID}" >> _config.yml
|
|
env:
|
|
STEPS_PREPARE_OUTPUTS_PRID: ${{ steps.prepare.outputs.prid }}
|
|
|
|
- name: Upload preview
|
|
run: |
|
|
mkdir -p "$HOME/.ssh"
|
|
echo "${{ secrets.CHATMAIL_STAGING_SSHKEY }}" > "$HOME/.ssh/key"
|
|
chmod 600 "$HOME/.ssh/key"
|
|
rsync -rILvh -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no" $GITHUB_WORKSPACE/doc/build/ "${{ secrets.USERNAME }}@chatmail.at:/var/www/html/staging.chatmail.at/doc/relay/${STEPS_PREPARE_OUTPUTS_PRID}/"
|
|
env:
|
|
STEPS_PREPARE_OUTPUTS_PRID: ${{ steps.prepare.outputs.prid }}
|
|
|
|
- name: check links
|
|
working-directory: doc
|
|
run: sphinx-build --builder linkcheck source build
|
|
|