Merge pull request #203 from ant-media/fix_secret_variable #142
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: | | ||
Check failure on line 14 in .github/workflows/deploy.yml GitHub Actions / .github/workflows/deploy.ymlInvalid workflow file
|
||
sed -i "s^baseUrl:.*^baseUrl:'/docs',^" docusaurus.config.js | ||
sed -i "s^appId.*^appId: '${{ secrets.ALGOLIA_APP_ID }}',^" docusaurus.config.js | ||
sed -i "s^apiKey.*^apiKey: '${{ secrets.$ALGOLIA_API_KEY }}',^" docusaurus.config.js | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.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 | ||