Skip to content

Commit

Permalink
add netlify deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
nil1729 committed Sep 14, 2023
1 parent 5191fc9 commit 1392607
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 42 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/netlify-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Netlify Deploy [Production]"

on:
push:
branches: [master]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Use Node.js 14.15.5
uses: actions/setup-node@v1
with:
node-version: 14.15.5
- run: npm run setup:frontend
- run: npm run build:frontend --if-present
- name: Deploy to netlify
uses: netlify/actions/cli@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.PROD_NETLIFY_SITE_ID }}
with:
args: deploy --dir=build --prod
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
package-lock.json
config.env
.vscode
public
public
build
80 changes: 40 additions & 40 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.4",
"@testing-library/user-event": "^13.5.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.0",
"react-scripts": "5.0.0",
"reactstrap": "^9.0.1",
"socket.io-client": "^4.4.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"deploy": "npm run build && rm -rf ../public/* && mv build/* ../public/"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.4",
"@testing-library/user-event": "^13.5.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.0",
"react-scripts": "5.0.0",
"reactstrap": "^9.0.1",
"socket.io-client": "^4.4.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"deploy": "CI=false npm run build"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"start": "node .",
"start:dev": "NODE_ENV=development PORT=5050 nodemon . --config nodemon.json",
"start:frontend": "npm start --prefix frontend",
"build:frontend": "npm run deploy --prefix frontend"
"setup:frontend": "npm install --prefix frontend",
"build:frontend": "npm run deploy --prefix frontend && mv frontend/build ."
},
"author": "Nilanjan Deb",
"license": "MIT",
Expand Down

0 comments on commit 1392607

Please sign in to comment.