Skip to content
Open
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
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: React-app-mulearn Native Deploy Pipeline

on:
push:
branches: ["task-3"]

# Specific permissions for deploying directly to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Prevent redundant builds from running at the same time and crashing into each other
concurrency:
group: "pages" # this is used to group the builds together.
cancel-in-progress: true # this is used to cancel the previous build if a new build is started.

jobs:
deploy:
# Here the enviornment is set to github-pages. This is needed because it automatically gives us that nice link in the Actions tab.
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: move code to Runner
uses: actions/checkout@v4

- name: Setup Node (because its a react app)
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies (npm i)
run: npm install
working-directory: ./sharonshaji-1@mulearn/Task-3

- name: Build the app (npm run build)
run: npm run build
working-directory: ./sharonshaji-1@mulearn/Task-3

- name: Setup GitHub Pages natively # This is needed to deploy the app directly to the GitHub Pages environment. earlier we used to do this manually by going to settings and enabling GitHub Pages. Now we can do it directly from the workflow.
uses: actions/configure-pages@v4 # The permissions we gave at the top are used here.

- name: Upload the dist folder as an artifact # This takes everything Vite outputs and bundles it into a zip package
uses: actions/upload-pages-artifact@v3
with:
path: './sharonshaji-1@mulearn/Task-3/dist' # This is the folder that contains the built app.

- name: Deploy the artifact directly to the GitHub Pages environment # This is the final step that deploys the app to the GitHub Pages environment.
id: deployment
uses: actions/deploy-pages@v4
10 changes: 10 additions & 0 deletions sharonshaji-1@mulearn/Task-2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.12-slim
#base image

WORKDIR /app
#working dir inside container.

COPY script.py .
#move the script to /app in container

CMD ["python", "-u", "script.py"]
7 changes: 7 additions & 0 deletions sharonshaji-1@mulearn/Task-2/script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import time

print("🚀 Container Started")

while True:
print("Hello World")
time.sleep(5)
24 changes: 24 additions & 0 deletions sharonshaji-1@mulearn/Task-3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
16 changes: 16 additions & 0 deletions sharonshaji-1@mulearn/Task-3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)

## React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).

## Expanding the ESLint configuration

If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
29 changes: 29 additions & 0 deletions sharonshaji-1@mulearn/Task-3/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'

export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{js,jsx}'],
extends: [
js.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
},
},
])
13 changes: 13 additions & 0 deletions sharonshaji-1@mulearn/Task-3/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>task-3</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading