From 0b783ddb3b9dd948164990795ec8e3f7a5cb290f Mon Sep 17 00:00:00 2001 From: Artem Streltsov Date: Sun, 20 Oct 2024 14:50:09 +0100 Subject: [PATCH] add deploy script --- .github/workflows/deploy.yml | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..20cc6ec --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,37 @@ +name: Deploy + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: '^1.22.4' + + - name: Run tests + run: go test ./... + + deploy: + runs-on: ubuntu-latest + needs: test + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Deploy to VPS + uses: will-lynas/go-vps-deploy@v0.1.0 + with: + host: ${{ secrets.VPS_HOST }} + username: ${{ secrets.VPS_USER }} + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + branch-name: master