31 lines
611 B
YAML
31 lines
611 B
YAML
|
# 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
|