Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CICD #19

Merged
merged 2 commits into from
Jul 2, 2024
Merged

CICD #19

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: FRONTEND Continuous Deployment

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "18.x"

- name: Install dependencies
run: |
cd frontend
npm install

- name: Build
run: |
cd frontend
npm run build

- name: Install Netlify CLI
run: npm install -g netlify-cli

- name: Deploy to Netlify
if: github.ref == 'refs/heads/master' # Deploy only on master branch
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{secrets.NETLIFY_SITE_ID}}
run: |
cd frontend
netlify deploy --prod --dir=build --site=${NETLIFY_SITE_ID} --message="Deployed from GitHub Actions"
2 changes: 1 addition & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
</html>
1 change: 1 addition & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function App() {
return (
<div>
<h1>Product Near You : frontend start now</h1>
<h1>CD : implemented</h1>
</div>
);
}
Expand Down
Loading