Merge pull request #166 from timantmedia/subscriber-block-tb #50
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
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
run_pull: | |
name: docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: sed -i "s^baseUrl:.*^baseUrl:'/docs',^" docusaurus.config.js | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- run: npm install | |
- run: npm run build | |
- run: cd build && tar -zcvf ../docs.tar . | |
- name: install ssh keys | |
run: | | |
install -m 600 -D /dev/null ~/.ssh/id_rsa | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts | |
- name: connect and upload | |
run: | | |
scp -r docs.tar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}":" | |
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "find /home/antmedia.io/public_html/docs/ -type f -not -name "*.tar" -not -path "/home/antmedia.io/public_html/docs/.ssh/*" -exec rm {} \; && tar -zxvf docs.tar && rm -rf docs.tar" | |
- name: cleanup | |
run: rm -rf ~/.ssh | |