Skip to content

Commit

Permalink
Merge pull request #14 from moheladwy/AddFirstPageInClient
Browse files Browse the repository at this point in the history
Update all workflows and client/Dockerfile
  • Loading branch information
moheladwy authored Jan 1, 2025
2 parents 2d3126f + fbcb8fe commit dc5837f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/docker-react-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ jobs:

- name: Build the Docker image
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/todo-client:${{ env.DATE_TAG }} client
docker build \
--build-arg VITE_SERVER_URL=${{ secrets.VITE_SERVER_URL }} \
--build-arg VITE_SERVER_LOGIN_PATH=Auth/login \
--build-arg VITE_SERVER_REGISTER_PATH=Auth/register \
--build-arg VITE_SERVER_REFRESH_PATH=Auth/refresh \
--build-arg VITE_SERVER_LOGOUT_PATH=Auth/logout \
-t ${{ secrets.DOCKERHUB_USERNAME }}/todo-client:${{ env.DATE_TAG }} client
- name: Tag the Docker image
run: |
# Tag with timestamp
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ASP.NET Linting

on:
push:
branches: "**"
branches-ignore: ["main"]
paths:
- "server/**"
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typescript-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: React TypeScript Linting

on:
push:
branches: "**"
branches-ignore: ["main"]
paths:
- "client/**"
pull_request:
Expand Down
15 changes: 15 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ WORKDIR /Todo
# Build stage for compiling and publishing the application
FROM base AS build
WORKDIR /Todo/src

# Add build arguments
ARG VITE_SERVER_URL
ARG VITE_SERVER_LOGIN_PATH
ARG VITE_SERVER_REGISTER_PATH
ARG VITE_SERVER_REFRESH_PATH
ARG VITE_SERVER_LOGOUT_PATH

# Set environment variables
ENV VITE_SERVER_URL=$VITE_SERVER_URL
ENV VITE_SERVER_LOGIN_PATH=$VITE_SERVER_LOGIN_PATH
ENV VITE_SERVER_REGISTER_PATH=$VITE_SERVER_REGISTER_PATH
ENV VITE_SERVER_REFRESH_PATH=$VITE_SERVER_REFRESH_PATH
ENV VITE_SERVER_LOGOUT_PATH=$VITE_SERVER_LOGOUT_PATH

COPY package*.json .
RUN npm install
COPY . .
Expand Down

0 comments on commit dc5837f

Please sign in to comment.