-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into addAppleSiliconInstallationGuide
- Loading branch information
Showing
23 changed files
with
528 additions
and
251 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,75 @@ | ||
name: Update Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '**/README.md' | ||
- '**/.github/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run_pull: | ||
name: docs | ||
runs-on: ubuntu-latest | ||
|
||
run_docker: | ||
name: Run Docker service | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: make changes | ||
- name : Start docker service | ||
run: | | ||
sudo usermod -aG docker $USER | ||
newgrp docker | ||
sudo systemctl restart docker | ||
run_build: | ||
name: Update Docs | ||
runs-on: self-hosted | ||
needs: run_docker | ||
|
||
container: | ||
image: ubuntu:22.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install SSH client | ||
run: | | ||
apt update | ||
apt install -y openssh-client -y | ||
- name: Make changes | ||
run: | | ||
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 | ||
- name: Set up Node.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 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Package build artifacts | ||
run: cd build && tar -zcvf ../docs.tar * | ||
|
||
- name: Install SSH keys | ||
run: | | ||
ls -alh | ||
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 | ||
ls -alh ~/.ssh/ | ||
- 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 | ||
ls -alh | ||
find / -iname "docs.tar" | ||
scp -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa -r docs.tar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}":" | ||
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ 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" | ||
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
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
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
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
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
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
Oops, something went wrong.