nows/.github/workflows/deploy.yml

31 lines
611 B
YAML
Raw Permalink Normal View History

2023-11-25 20:08:30 +08:00
# 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