From 59ae2914aa9a64811a114e1f3b6dd6d9349d4169 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 9 Aug 2024 02:22:25 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=8B=20ci:=20deploy=20test=20server=20p?= =?UTF-8?q?ost-dev=20image=20build=20(#3596)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-dev.yml | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/deploy-dev.yml diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml new file mode 100644 index 0000000000..457f6b8ceb --- /dev/null +++ b/.github/workflows/deploy-dev.yml @@ -0,0 +1,37 @@ +name: Update DigitalOcean Server + +on: + workflow_run: + workflows: ["Docker Dev Images Build"] + types: + - completed + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + if: | + github.repository == 'danny-avila/LibreChat' && + (github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success') + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Run update script on DigitalOcean Droplet + run: | + doctl compute ssh ${{ secrets.DO_DROPLET_NAME }} --ssh-command ' + sudo -i -u danny bash << EOF + cd ~/LibreChat && \ + git fetch origin main && \ + git checkout do-deploy && \ + git rebase origin/main && \ + npm run update:deployed && \ + npm run start:deployed && \ + echo "Update completed. Application should be running now." + EOF + '