add deploy.yml
This commit is contained in:
parent
e173e71027
commit
e0cd0b0cb5
1 changed files with 32 additions and 0 deletions
32
.forgejo/deploy.yml
Normal file
32
.forgejo/deploy.yml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
name: Deploy to VPS
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- live
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.22'
|
||||
- name: Build
|
||||
run: go build -o potoforio main.go
|
||||
- name: Deploy
|
||||
uses: appleboy/scp-action@master
|
||||
with:
|
||||
host: ${{ secrets.VPS_HOST }}
|
||||
username: ${{ secrets.VPS_USER }}
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
source: "potoforio"
|
||||
target: "~/potoforio"
|
||||
- name: Restart service
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.VPS_HOST }}
|
||||
username: ${{ secrets.VPS_USER }}
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
script: "sudo systemctl restart potoforio.service"
|
||||
Loading…
Add table
Add a link
Reference in a new issue