-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.75 KB
/
cd.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
50
51
52
53
54
name: Node.js CD
on:
push:
branches: [ main ]
env:
PORT: ${{secrets.API_PORT}}
TS3_HOST: ${{secrets.TS3_HOST}}
TS3_SERVER_PORT: ${{secrets.TS3_PORT}}
TS3_QUERY_PORT: ${{secrets.TS3_QUERY_PORT}}
TS3_USER: ${{secrets.TS3_USER}}
TS3_PASS: ${{secrets.TS3_PASS}}
TS3_NICK: ${{secrets.TS3_NICK}}
jobs:
build:
runs-on: [self-hosted, ARM64]
steps:
- uses: actions/checkout@v2
- uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
target_url: https://tsapi.n1eko.com/
environment: production
- run: docker build . -t tsapi:0.0.1
- name: Create env file
run: |
touch .env
echo PORT=${{ secrets.API_PORT }} >> .env
echo TS3_HOST=${{ secrets.TS3_HOST }} >> .env
echo TS3_SERVER_PORT=${{ secrets.TS3_PORT }} >> .env
echo TS3_QUERY_PORT=${{ secrets.TS3_QUERY_PORT }} >> .env
echo TS3_USER=${{ secrets.TS3_USER }} >> .env
echo TS3_PASS=${{ secrets.TS3_PASS }} >> .env
echo TS3_NICK=${{ secrets.TS3_NICK }} >> .env
- run: docker-compose up -d
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: https://tsapi.n1eko.com/
state: "success"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: https://tsapi.n1eko.com/
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}