From 6e68b2da5843e8288256319e50e2807d65bb7742 Mon Sep 17 00:00:00 2001 From: sianida26 Date: Tue, 20 Feb 2024 00:18:15 +0700 Subject: [PATCH] CD --- .github/workflows/deploy-production.yml | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/deploy-production.yml diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml new file mode 100644 index 0000000..c8a2e66 --- /dev/null +++ b/.github/workflows/deploy-production.yml @@ -0,0 +1,29 @@ +name: Deploy + +on: + push: + branches: + - main + +jobs: + cd: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Deploy to server + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.SSHKEY }} + port: ${{ secrets.PORT }} + script: | + cd ~/resellease + git pull origin main + git status + bun install + bun build + pm2 reload resellease + pm2 restart resellease \ No newline at end of file