Update .forgejo/workflows/deploy.yaml
Some checks failed
Deploy to server / deploy (push) Has been cancelled
Some checks failed
Deploy to server / deploy (push) Has been cancelled
This commit is contained in:
parent
35bc5c8e95
commit
32c0719176
|
@ -1,6 +0,0 @@
|
|||
on: [push]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- run: echo All Good
|
28
.forgejo/workflows/deploy.yaml
Normal file
28
.forgejo/workflows/deploy.yaml
Normal file
|
@ -0,0 +1,28 @@
|
|||
name: Deploy to server
|
||||
on: push
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up SSH key
|
||||
run: |
|
||||
env
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.ARTIFACT_SSH_KEY }}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -p 22 ${{ secrets.ARTIFACT_HOST }} >> ~/.ssh/known_hosts
|
||||
sudo apt-get install sshpass
|
||||
|
||||
- name: Deploy to server
|
||||
run: |
|
||||
sshpass -p '${{ secrets.PSWD }}' ssh -v -o StrictHostKeyChecking=no ${{ secrets.USER }}@${{ secrets.HOST }} <<'ENDSSH'
|
||||
cd ${{ secrets.APP_PATH }}
|
||||
git pull
|
||||
docker stop ${{ secrets.APP_NAME }}
|
||||
docker system prune -f
|
||||
export ${{ secrets.API_KEY_NAME }}=${{ secrets.API_KEY }}
|
||||
make deploy_headless
|
||||
ENDSSH
|
Loading…
Reference in a new issue