add github workflow
This commit is contained in:
parent
a34521973f
commit
79dcf49d5a
30
.github/workflows/deploy.yml
vendored
Normal file
30
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
name: Deploy to VPS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up SSH
|
||||
uses: webfactory/ssh-agent@v0.8.1
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.VPS_SSH_KEY }}
|
||||
|
||||
- name: Deploy via SSH
|
||||
env:
|
||||
USER: ${{ secrets.VPS_USER }}
|
||||
HOST: ${{ secrets.VPS_HOST }}
|
||||
run: |
|
||||
ssh -o StrictHostKeyChecking=no $USER@$HOST << 'EOF'
|
||||
cd ~/portfolio/
|
||||
git pull origin main
|
||||
docker compose up --build -d
|
||||
EOF
|
||||
Loading…
x
Reference in New Issue
Block a user