forked from NodeBB/NodeBB
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (85 loc) · 3.57 KB
/
deployment.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Deployment CI
on: [ push, pull_request ]
jobs:
# DEPLOY FORUM (DEVELOP)
deploy-blog-dev:
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create env variables file
run: ./create_env_file.sh
env:
NODE_ENV: development
PORT: 4687
DATA_PATH: ${{ secrets.DEV__DATA_PATH }}
URL: https://devforum.binary-coffee.dev
DB_USER: ""
DB_PASSWORD: ""
DB_HOST: ${{ secrets.DEV__DB_HOST }}
DB_PORT: ${{ secrets.DEV__DB_PORT }}
DB_NAME: ${{ secrets.DEV__DB_NAME }}
SECRET: ${{ secrets.DEV__SECRET }}
ADMIN_NAME: ${{ secrets.DEV__ADMIN_NAME }}
ADMIN_EMAIL: ${{ secrets.DEV__ADMIN_EMAIL }}
ADMIN_PASSWORD: ${{ secrets.DEV__ADMIN_PASSWORD }}
BINARY_GRAPHQL_API: https://api-dev.binary-coffee.dev/graphql
BINARY_LOGIN_PAGE: https://dev.binary-coffee.dev/dashboard/login
- name: Copy project to the hosting
uses: easingthemes/ssh-deploy@v2.1.5
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: "-rltgoDzvO --delete"
SOURCE: ""
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.DEV__REMOTE_TARGET }}
- name: Deploy project with docker in hosting
uses: garygrossgarten/github-action-ssh@release
with:
command: cd ${{ secrets.DEV__REMOTE_TARGET }} && ./deploy.sh dev_nodebb
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
privateKey: ${{ secrets.SERVER_SSH_KEY}}
# DEPLOY FORUM (PRODUCTION)
deploy-blog-prod:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create env variables file
run: ./create_env_file.sh
env:
NODE_ENV: development
PORT: 4688
DATA_PATH: ${{ secrets.PROD__DATA_PATH }}
URL: https://forum.binary-coffee.dev
DB_USER: ""
DB_PASSWORD: ""
DB_HOST: ${{ secrets.PROD__DB_HOST }}
DB_PORT: ${{ secrets.PROD__DB_PORT }}
DB_NAME: ${{ secrets.PROD__DB_NAME }}
SECRET: ${{ secrets.PROD__SECRET }}
ADMIN_NAME: ${{ secrets.PROD__ADMIN_NAME }}
ADMIN_EMAIL: ${{ secrets.PROD__ADMIN_EMAIL }}
ADMIN_PASSWORD: ${{ secrets.PROD__ADMIN_PASSWORD }}
BINARY_GRAPHQL_API: https://api.binary-coffee.dev/graphql
BINARY_LOGIN_PAGE: https://binary-coffee.dev/dashboard/login
- name: Copy project to the hosting
uses: easingthemes/ssh-deploy@v2.1.5
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: "-rltgoDzvO --delete"
SOURCE: ""
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.PROD__REMOTE_TARGET }}
- name: Deploy project with docker in hosting
uses: garygrossgarten/github-action-ssh@release
with:
command: cd ${{ secrets.PROD__REMOTE_TARGET }} && ./deploy.sh prod_nodebb
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
privateKey: ${{ secrets.SERVER_SSH_KEY}}