Skip to content

Commit

Permalink
Merge pull request #219 from ant-media/remove_sudo
Browse files Browse the repository at this point in the history
remove sudo command
  • Loading branch information
Mohit-3196 authored Feb 21, 2024
2 parents 7182e07 + 7e6c4e8 commit 874e277
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ name: Update Docs
on:
push:
branches:
- master
- '*'
# - master
paths-ignore:
- '**/README.md'
- '**/.github/**'
# - '**/.github/**'
workflow_dispatch:

jobs:
Expand All @@ -33,8 +34,8 @@ jobs:

- name: Install SSH client
run: |
sudo apt update
sudo apt install -y openssh-client -y
apt update
apt install -y openssh-client -y
- name: Make changes
run: |
sed -i "s^baseUrl:.*^baseUrl:'/docs',^" docusaurus.config.js
Expand All @@ -57,13 +58,18 @@ jobs:

- 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
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"
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"

0 comments on commit 874e277

Please sign in to comment.