-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
107 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,48 @@ | ||
name: .NET | ||
|
||
on: | ||
push: | ||
branches: ["main", "controllers", "deploy"] | ||
pull_request: | ||
branches: ["main", "controllers", "deploy"] | ||
|
||
jobs: | ||
build: | ||
env: | ||
ASPNETCORE_ENVIRONMENT: "Development" | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 # Check out the code from the repository | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 # Set up the .NET SDK | ||
with: | ||
dotnet-version: 8.0.x # Specify the exact .NET SDK version | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore ./backend # Restore project dependencies | ||
|
||
- name: Test | ||
run: dotnet test --verbosity normal ./backend # Run tests | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release ./backend --runtime linux-x64 # Build the project | ||
|
||
- name: Deploy to server | ||
run: | | ||
cp -rf ./backend/bin/net8.0/linux-x64/* /home/datnt/datj-backend/ | ||
shell: bash | ||
# name: CI/CD Pipeline | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# branches: | ||
# - main | ||
|
||
# jobs: | ||
# build-and-deploy: | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
|
||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v1 | ||
|
||
# - name: Log in to Azure Container Registry | ||
# uses: azure/docker-login@v1 | ||
# with: | ||
# login-server: <YourACRName>.azurecr.io | ||
# username: ${{ secrets.AZURE_ACR_USERNAME }} | ||
# password: ${{ secrets.AZURE_ACR_PASSWORD }} | ||
|
||
# - name: Build and push backend Docker image | ||
# run: | | ||
# docker-compose -f docker-compose.yml build backend | ||
# docker tag myapp_backend:latest <YourACRName>.azurecr.io/myapp_backend:latest | ||
# docker push <YourACRName>.azurecr.io/myapp_backend:latest | ||
|
||
# - name: Build and push frontend Docker image | ||
# run: | | ||
# docker-compose -f docker-compose.yml build frontend | ||
# docker tag myapp_frontend:latest <YourACRName>.azurecr.io/myapp_frontend:latest | ||
# docker push <YourACRName>.azurecr.io/myapp_frontend:latest | ||
|
||
# - name: Deploy to Azure Web App | ||
# uses: azure/webapps-deploy@v2 | ||
# with: | ||
# app-name: <YourAppServiceName> | ||
# slot-name: production | ||
# images: | | ||
# <YourACRName>.azurecr.io/myapp_backend:latest | ||
# <YourACRName>.azurecr.io/myapp_frontend:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
frontend/src/pages/dashboard/warranty_card/components/WarrantyRow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
server { | ||
listen 80; | ||
|
||
location / { | ||
proxy_pass http://frontend:3000; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location /api { | ||
proxy_pass http://backend:8080; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} |