Docgen action #4
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: Docgen action | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'stiller-backend/docs/*' | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: system deps | |
run: | | |
sudo apt install --upgrade -y openssh-client openssh-known-hosts openssh-server | |
- name: ssh setup | |
run: | | |
mkdir -p ~/.ssh/ | |
chmod 700 ~/.ssh/ | |
eval "$(ssh-agent -s)" | |
echo "${{ secrets.SSH_PRIVKEY }}" | tr -d '\r' > ~/.ssh/id_rsa | |
echo "${{ secrets.SSH_PUBKEY }}" | tr -d '\r' > ~/.ssh/id_rsa.pub | |
chmod 600 ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa.pub | |
ssh-add -vvv | |
ls ~/.ssh/ | |
ssh-keyscan -H "${{ secrets.SSH_IP }}" >> ~/.ssh/known_hosts | |
- name: build | |
run: ssh -vT "bauer@${{ secrets.SSH_IP }}" "cd ~/clones/metagallery/stiller-backend/docs && mdbook build" | |
- name: deploy | |
run: ssh -vT "bauer@${{ secrets.SSH_IP }}" "sudo cp -r ~/clones/metagallery/stiller-backend/docs/book /var/www/stillerdocs && sudo chown --recursive www-data /var/www/stillerdocs" |