-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (29 loc) · 1.09 KB
/
deploy-commands.yml
File metadata and controls
37 lines (29 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Deploy Discord Commands
on:
workflow_dispatch: # Manual trigger only
jobs:
deploy-commands:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Read Node version
run: |
NODE_VERSION=$(cat .nvmrc | sed 's/v//')
echo "NODE_VERSION=$NODE_VERSION" >> $GITHUB_ENV
- name: Deploy Discord Commands to VPS
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
script: |
cd /home/${{ secrets.VPS_USER }}/webdev-bot-deploy
# Read NODE_VERSION from .nvmrc
export NODE_VERSION=$(cat .nvmrc | sed 's/v//')
echo "Using Node version: $NODE_VERSION"
# Run deploy script inside the already running Docker container
# .env file should already exist from main deployment
echo "Deploying Discord commands..."
docker compose --profile prod exec bot-prod node dist/util/deploy.js
echo "Discord commands deployment completed!"