appleboy pls help

This commit is contained in:
Kim 2023-11-06 13:11:04 +01:00
parent bb49cda7ad
commit 56d2e9712a
1 changed files with 55 additions and 24 deletions

View File

@ -21,28 +21,59 @@ jobs:
- run: | - run: |
npm --prefix ${{ gitea.workspace }}/typescript/frontend-marios2 install npm --prefix ${{ gitea.workspace }}/typescript/frontend-marios2 install
npm --prefix ${{ gitea.workspace }}/typescript/frontend-marios2 run build npm --prefix ${{ gitea.workspace }}/typescript/frontend-marios2 run build
- name: Configure SSH - name: Copy Backend
run: | uses: appleboy/scp-action@v0.1.4
mkdir -p /root/.ssh/ with:
touch /root/.ssh/config host: 91.92.154.141
echo '$SSH_KEY' > /root/.ssh/id_rsa username: ubuntu
chmod 700 /root/.ssh/id_rsa key: ${{ secrets.STAGING_SSH_KEY }}
source: "${{ gitea.workspace }}/csharp/App/Backend/bin/Release/net6.0/linux-x64/publish/"
target: "staging:~/backend"
cat >> /root/.ssh/config <<END - name: Copy Frontend
Host staging uses: appleboy/scp-action@v0.1.4
HostName $SSH_HOST with:
User $SSH_USER host: 91.92.154.141
IdentityFile /root/.ssh/id_rsa username: ubuntu
StrictHostKeyChecking no key: ${{ secrets.STAGING_SSH_KEY }}
END source: "${{ gitea.workspace }}/typescript/frontend-marios2/"
env: target: "staging:~/frontend"
SSH_USER: ubuntu
SSH_HOST: 91.92.154.141 - name: restart services
SSS_KEY: ${{ secrets.STAGING_SSH_KEY }} uses: appleboy/ssh-action@v0.1.4
- run: sudo su with:
- run: scp -vo StrictHostKeyChecking=no -r ${{ gitea.workspace }}/csharp/App/Backend/bin/Release/net6.0/linux-x64/publish/ staging:~/backend host: 91.92.154.141
- run: scp -vo StrictHostKeyChecking=no -r ${{ gitea.workspace }}/typescript/frontend-marios2/* staging:~/frontend/ username: ubuntu
- run: ssh -vo StrictHostKeyChecking=no staging 'sudo systemctl restart backend' key: ${{ secrets.STAGING_SSH_KEY }}
- run: ssh -vo StrictHostKeyChecking=no staging 'sudo cp -rf ~/frontend/build/* /var/www/html/monitor.innov.energy/html/' script: |
- run: ssh -vo StrictHostKeyChecking=no staging 'sudo npm install -g serve' sudo systemctl restart backend
- run: echo " This job's status is ${{ job.status }}." sudo cp -rf ~/frontend/build/* /var/www/html/monitor.innov.energy/html/
sudo npm install -g serve
- run: echo " This job's status is ${{ job.status }}."
# - name: Configure SSH
# run: |
# mkdir -p /root/.ssh/
# touch /root/.ssh/config
# echo '$SSH_KEY' > /root/.ssh/id_rsa
# chmod 700 /root/.ssh/id_rsa
#
# cat >> /root/.ssh/config <<END
# Host staging
# HostName $SSH_HOST
# User $SSH_USER
# IdentityFile /root/.ssh/id_rsa
# StrictHostKeyChecking no
# END
# env:
# SSH_USER: ubuntu
# SSH_HOST: 91.92.154.141
# SSS_KEY: ${{ secrets.STAGING_SSH_KEY }}
# - run: scp -vo StrictHostKeyChecking=no -r ${{ gitea.workspace }}/csharp/App/Backend/bin/Release/net6.0/linux-x64/publish/ staging:~/backend
# - run: scp -vo StrictHostKeyChecking=no -r ${{ gitea.workspace }}/typescript/frontend-marios2/* staging:~/frontend/
# - run: ssh -vo StrictHostKeyChecking=no staging 'sudo systemctl restart backend'
# - run: ssh -vo StrictHostKeyChecking=no staging 'sudo cp -rf ~/frontend/build/* /var/www/html/monitor.innov.energy/html/'
# - run: ssh -vo StrictHostKeyChecking=no staging 'sudo npm install -g serve'
# - run: echo " This job's status is ${{ job.status }}."