Deploy workflow
This commit is contained in:
parent
73d256cac1
commit
567293c89e
1 changed files with 27 additions and 0 deletions
27
.github/workflows/deploy.yml
vendored
Normal file
27
.github/workflows/deploy.yml
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
name: Deploy to Server
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Add SSH key
|
||||||
|
uses: webfactory/ssh-agent@v0.7.0
|
||||||
|
with:
|
||||||
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Deploy to server
|
||||||
|
run: |
|
||||||
|
ssh -o StrictHostKeyChecking=no ${{ secrets.USERNAME }}@${{ secrets.SERVER_IP }} "
|
||||||
|
cd ${{ secrets.PROJECT_PATH }} &&
|
||||||
|
git fetch origin deploy &&
|
||||||
|
git reset --hard origin/deploy
|
||||||
|
"
|
Loading…
Add table
Add a link
Reference in a new issue