diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 3847ef0..b0d5781 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -8,11 +8,11 @@ on: jobs: build: - runs-on: [self-hosted, Linux, X64, marquinhos-ci] + runs-on: [self-hosted, Linux, X64] strategy: matrix: - node-version: [20.x] + node-version: [18.x] steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} @@ -24,27 +24,9 @@ jobs: - run: npm run build deploy: needs: build - runs-on: [self-hosted, Linux, X64, marquinhos-ci] + runs-on: [self-hosted, Linux, X64] steps: - - name: Stop service - continue-on-error: true - run: systemctl --user stop marquinhos-bot.service - - name: Copy service file - run: | - sed -i "s|%WORKING_DIRECTORY%|$(pwd)|g" marquinhos-bot.service - cp marquinhos-bot.service ~/.config/systemd/user/marquinhos-bot.service - - name: Reload systemd - run: machinectl --uid=marquinhos --quiet shell - systemctl --user daemon-reload - - name: Start service - run: systemctl --user start marquinhos-bot.service - - name: Check status - id: check-status - run: - if [ "$(systemctl --user is-active marquinhos-bot.service)" != "active" ]; then - echo "Service is not running or has failed" - exit 1 - fi - - name: Fail if service is not running - if: steps.check-status.outcome != 'success' - run: exit 1 + - name: Make deploy.sh executable + run: chmod +x ./deploy.sh + - name: Execute deploy.sh + run: echo "${{ secrets.DVNS_CLUSTER_PASSWORD }}" | sudo -S ./deploy.sh "$(pwd)/dist" diff --git a/marquinhos-bot.service b/marquinhos-bot.service deleted file mode 100644 index 5efd0bc..0000000 --- a/marquinhos-bot.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=MarquinhosBOT -After=network.target - -[Service] -EnvironmentFile=/etc/marquinhos/marquinhos.conf -Environment="NODE_ENV=production" -User=marquinhos -WorkingDirectory=%WORKING_DIRECTORY% -ExecStart=node -r tsconfig-paths/register ./index.js -Restart=always -RestartSec=30 -StartLimitInterval=0 - - -[Install] -WantedBy=default.target \ No newline at end of file