From e0cd0b0cb5294814b5c79b404b45c8af0971f1fc Mon Sep 17 00:00:00 2001 From: juancwu <46619361+juancwu@users.noreply.github.com> Date: Thu, 1 Jan 2026 18:52:29 -0500 Subject: [PATCH] add deploy.yml --- .forgejo/deploy.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .forgejo/deploy.yml diff --git a/.forgejo/deploy.yml b/.forgejo/deploy.yml new file mode 100644 index 0000000..13116f9 --- /dev/null +++ b/.forgejo/deploy.yml @@ -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"