add workflow

This commit is contained in:
Zichao Lin 2023-11-25 20:08:30 +08:00
parent 0280256a9f
commit 90f506153f
Signed by: earthjasonlin
GPG Key ID: 406D9913DE2E42FB

30
.github/workflows/deploy.yml vendored Normal file

@ -0,0 +1,30 @@
# This runs on GitHub only
name: Deploy
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install expect
run: |
sudo apt-get update
sudo apt-get install -y expect
- name: Deploy
run: |
expect - <<EOF
spawn ssh -p ${{ secrets.PORT }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} "cd ${{ secrets.PATH }} && git pull"
expect "?"
send "yes\r"
expect "password:"
send "${{ secrets.PASSWORD }}\r"
expect eof
EOF