Skip to content

Commit 6dc777f

Browse files
committed
Merge branch 'development'
2 parents 3950b84 + 94efb0d commit 6dc777f

File tree

8 files changed

+35
-16
lines changed

8 files changed

+35
-16
lines changed

.env.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# add the project root here
2+
PUBLIC_SITE_ROOT=http://localhost:3000

.github/workflows/ci-cd-pipeline.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ jobs:
4343
secrets: inherit
4444
with:
4545
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

.github/workflows/deploy.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ jobs:
3838
name: ${{ vars.PROJECT_NAME }}
3939
path: ${{ vars.PROJECT_NAME }}
4040

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-
5141
- name: Deploy files to VPS
5242
# Clears existing files and deploy new files
5343
run: |

.github/workflows/lint-and-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
description: 'The deployment environment e.g. production or development'
1717
required: true
1818
type: string
19+
skip_deploy:
20+
description: 'Skip the deploy step (true/false)'
21+
required: true
22+
type: boolean
1923

2024
jobs:
2125
lint:
@@ -52,6 +56,9 @@ jobs:
5256
- name: Checkout code
5357
# Checks out the repository code.
5458
uses: actions/checkout@v4
59+
60+
- name: Load env file
61+
run: echo "${{ secrets.APPLICATION_ENV_FILE }}" > .env
5562

5663
- name: Setup Node.js ${{ inputs.node-version }}
5764
# Sets up NodeJS environment
@@ -78,6 +85,7 @@ jobs:
7885
trigger-deploy:
7986
needs: build
8087
name: Deploy
88+
if: ${{ inputs.skip_deploy == false }}
8189
uses: ./.github/workflows/deploy.yml
8290
secrets: inherit
8391
with:

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
# development files
77
.docusaurus/
88

9+
# env
10+
.env
11+
.env.*
12+
!.env.template
13+
914
# production
1015
/build
1116
*.tgz
1217

1318
# misc
1419
.DS_Store
15-
.env.local
16-
.env.development.local
17-
.env.test.local
18-
.env.production.local
1920

2021
npm-debug.log*
2122
yarn-debug.log*

docusaurus.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @ts-check
22
// Note: type annotations allow type checking and IDEs autocompletion
33

4+
require('dotenv').config();
45
const {themes} = require('prism-react-renderer');
56
const lightCodeTheme = themes.github;
67
const darkCodeTheme = themes.dracula;
@@ -38,7 +39,7 @@ const config = {
3839
favicon: 'img/favicon.ico',
3940

4041
// Set the production url of your site here
41-
url: 'https://react-chatbotify.com',
42+
url: process.env.PUBLIC_SITE_ROOT || 'http://localhost:3000',
4243
// Set the /<baseUrl>/ pathname under which your site is served
4344
// For GitHub pages deployment, it is often '/<projectName>/'
4445
baseUrl: '/',
@@ -89,6 +90,7 @@ const config = {
8990
logo: {
9091
alt: 'React ChatBotify Logo',
9192
src: 'img/react-chatbotify.png',
93+
href: process.env.PUBLIC_SITE_ROOT || '/',
9294
},
9395
items: [
9496
{

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@docusaurus/module-type-aliases": "^3.2.0",
3939
"@tsconfig/docusaurus": "^2.0.2",
4040
"@typescript-eslint/eslint-plugin": "^5.60.1",
41+
"dotenv": "^16.5.0",
4142
"eslint": "^8.43.0",
4243
"eslint-plugin-import": "^2.27.5",
4344
"eslint-plugin-jsx-a11y": "^6.7.1",

0 commit comments

Comments
 (0)