File tree Expand file tree Collapse file tree 8 files changed +35
-16
lines changed Expand file tree Collapse file tree 8 files changed +35
-16
lines changed Original file line number Diff line number Diff line change
1
+ # add the project root here
2
+ PUBLIC_SITE_ROOT=http://localhost:3000
Original file line number Diff line number Diff line change 43
43
secrets : inherit
44
44
with :
45
45
target_env : ${{ github.ref == 'refs/heads/master' && 'production' || github.ref == 'refs/heads/development' && 'development' || 'invalid' }}
46
- node-version : " 22.4.1"
46
+ node-version : " 22.4.1"
47
+ skip_deploy : ${{ github.event_name == 'pull_request' }} # skip deployment if it's a pull request
Original file line number Diff line number Diff line change 38
38
name : ${{ vars.PROJECT_NAME }}
39
39
path : ${{ vars.PROJECT_NAME }}
40
40
41
- # temp: for debugging
42
- - name : List files after artifact download
43
- run : |
44
- echo ">>> Listing the top-level workspace directories:"
45
- ls -la
46
- echo ">>> Listing contents of ${{ vars.PROJECT_NAME }} (artifact folder):"
47
- ls -la ${{ vars.PROJECT_NAME }}
48
- echo ">>> Full recursive tree of ${{ vars.PROJECT_NAME }}:"
49
- ls -R ${{ vars.PROJECT_NAME }}
50
-
51
41
- name : Deploy files to VPS
52
42
# Clears existing files and deploy new files
53
43
run : |
Original file line number Diff line number Diff line change 16
16
description : ' The deployment environment e.g. production or development'
17
17
required : true
18
18
type : string
19
+ skip_deploy :
20
+ description : ' Skip the deploy step (true/false)'
21
+ required : true
22
+ type : boolean
19
23
20
24
jobs :
21
25
lint :
52
56
- name : Checkout code
53
57
# Checks out the repository code.
54
58
uses : actions/checkout@v4
59
+
60
+ - name : Load env file
61
+ run : echo "${{ secrets.APPLICATION_ENV_FILE }}" > .env
55
62
56
63
- name : Setup Node.js ${{ inputs.node-version }}
57
64
# Sets up NodeJS environment
78
85
trigger-deploy :
79
86
needs : build
80
87
name : Deploy
88
+ if : ${{ inputs.skip_deploy == false }}
81
89
uses : ./.github/workflows/deploy.yml
82
90
secrets : inherit
83
91
with :
Original file line number Diff line number Diff line change 6
6
# development files
7
7
.docusaurus /
8
8
9
+ # env
10
+ .env
11
+ .env. *
12
+ ! .env.template
13
+
9
14
# production
10
15
/build
11
16
* .tgz
12
17
13
18
# misc
14
19
.DS_Store
15
- .env.local
16
- .env.development.local
17
- .env.test.local
18
- .env.production.local
19
20
20
21
npm-debug.log *
21
22
yarn-debug.log *
Original file line number Diff line number Diff line change 1
1
// @ts -check
2
2
// Note: type annotations allow type checking and IDEs autocompletion
3
3
4
+ require ( 'dotenv' ) . config ( ) ;
4
5
const { themes} = require ( 'prism-react-renderer' ) ;
5
6
const lightCodeTheme = themes . github ;
6
7
const darkCodeTheme = themes . dracula ;
@@ -38,7 +39,7 @@ const config = {
38
39
favicon : 'img/favicon.ico' ,
39
40
40
41
// Set the production url of your site here
41
- url : 'https ://react-chatbotify.com ',
42
+ url : process . env . PUBLIC_SITE_ROOT || 'http ://localhost:3000 ',
42
43
// Set the /<baseUrl>/ pathname under which your site is served
43
44
// For GitHub pages deployment, it is often '/<projectName>/'
44
45
baseUrl : '/' ,
@@ -89,6 +90,7 @@ const config = {
89
90
logo : {
90
91
alt : 'React ChatBotify Logo' ,
91
92
src : 'img/react-chatbotify.png' ,
93
+ href : process . env . PUBLIC_SITE_ROOT || '/' ,
92
94
} ,
93
95
items : [
94
96
{
Original file line number Diff line number Diff line change 38
38
"@docusaurus/module-type-aliases" : " ^3.2.0" ,
39
39
"@tsconfig/docusaurus" : " ^2.0.2" ,
40
40
"@typescript-eslint/eslint-plugin" : " ^5.60.1" ,
41
+ "dotenv" : " ^16.5.0" ,
41
42
"eslint" : " ^8.43.0" ,
42
43
"eslint-plugin-import" : " ^2.27.5" ,
43
44
"eslint-plugin-jsx-a11y" : " ^6.7.1" ,
You can’t perform that action at this time.
0 commit comments