-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (44 loc) · 1.28 KB
/
deploy.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
name: Build and deploy Node.js
on:
push:
branches:
- main
- test-any-bot
workflow_dispatch:
env:
NODE_VERSION: 18
jobs:
deploy:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- runner: [self-hosted, prod]
branch: refs/heads/main
stand: prod
anybotPort: 3000
timerTriggerPort: 3001
blobPort: 10000
- runner: [self-hosted, test]
branch: refs/heads/test-any-bot
stand: test
anybotPort: 3002
timerTriggerPort: 3003
blobPort: 11000
steps:
- name: 'Checkout GitHub Action'
if: ${{ github.ref == matrix.branch }}
uses: actions/checkout@v2
- name: Set stand variable
if: ${{ github.ref == matrix.branch }}
run: |
echo "STAND=${{ matrix.stand }}" > .env
echo "ANYBOT_PORT=${{ matrix.anybotPort }}" >> .env
echo "TIMER_TRIGGER_PORT=${{ matrix.timerTriggerPort }}" >> .env
echo "BLOB_PORT=${{ matrix.blobPort }}" >> .env
- name: restart docker compose
if: ${{ github.ref == matrix.branch }}
run: |
docker-compose stop
docker system prune --all --volumes --force
docker-compose up -d