add workflow
This commit is contained in:
parent
0280256a9f
commit
90f506153f
30
.github/workflows/deploy.yml
vendored
Normal file
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
|
Loading…
x
Reference in New Issue
Block a user