Skip to content

Commit

Permalink
Merge pull request #13 from moheladwy/AddFirstPageInClient
Browse files Browse the repository at this point in the history
Add first page in client
  • Loading branch information
moheladwy authored Jan 1, 2025
2 parents 5622ada + a99030f commit 2d3126f
Show file tree
Hide file tree
Showing 43 changed files with 1,796 additions and 70 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Docker Image Deploy
name: Docker Image Deploy for ASP.NET Web API

on:
push:
branches: ["main"]
paths:
- "server/**"

jobs:
build:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/docker-react-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Docker Image Deploy for React Client

on:
push:
branches: ["main"]
paths:
- "client/**"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set date tag
run: echo "DATE_TAG=$(date +%s)" >> $GITHUB_ENV

- name: Build the Docker image
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/todo-client:${{ env.DATE_TAG }} client
- name: Tag the Docker image
run: |
# Tag with timestamp
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/todo-client:${{ env.DATE_TAG }} ${{ secrets.DOCKERHUB_USERNAME }}/todo-client:${{ env.DATE_TAG }}
# Tag as latest
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/todo-client:${{ env.DATE_TAG }} ${{ secrets.DOCKERHUB_USERNAME }}/todo-client:latest
- name: Push the Docker image
run: |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/todo-client:${{ env.DATE_TAG }}
docker push ${{ secrets.DOCKERHUB_USERNAME }}/todo-client:latest
10 changes: 7 additions & 3 deletions .github/workflows/dotnet-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ name: ASP.NET Linting
on:
push:
branches: "**"
paths:
- "server/**"
pull_request:
branches: ["main"]
paths:
- "server/**"

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: server

steps:
- name: Checkout code
Expand All @@ -21,12 +28,9 @@ jobs:

- name: Restore dependencies
run: dotnet restore
working-directory: server

- name: Build
run: dotnet build --no-restore
working-directory: server

- name: Test
run: dotnet test --no-build --verbosity normal
working-directory: server
41 changes: 41 additions & 0 deletions .github/workflows/typescript-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: React TypeScript Linting

on:
push:
branches: "**"
paths:
- "client/**"
pull_request:
branches: ["main"]
paths:
- "client/**"

jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: client

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: client/package-lock.json

- name: Install dependencies
run: npm ci

- name: Type check
run: npx tsc --noEmit

- name: Run ESLint
run: npm run lint

- name: Build application
run: npm run build
16 changes: 16 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Description: Dockerfile for the client side of the application
FROM node:20-alpine AS base
WORKDIR /Todo

# Build stage for compiling and publishing the application
FROM base AS build
WORKDIR /Todo/src
COPY package*.json .
RUN npm install
COPY . .
RUN npm run build

# Final stage with the runtime environment
FROM base AS final
WORKDIR /Todo
COPY --from=build /Todo/src/dist .
25 changes: 14 additions & 11 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Todo Application</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tasker</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

</html>
Loading

0 comments on commit 2d3126f

Please sign in to comment.