Add project
This commit is contained in:
82
.gitea/workflows/deploy.yaml
Normal file
82
.gitea/workflows/deploy.yaml
Normal file
@@ -0,0 +1,82 @@
|
||||
name: SanStudent Multi-Project Deployment
|
||||
run-name: ${{ github.actor }} wdraża system SanStudent 🚀
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'Api/**'
|
||||
- 'FrontAdmin/**'
|
||||
- 'FrontStudent/**'
|
||||
- 'Common/**'
|
||||
- 'sanstudent.sln'
|
||||
- '.gitea/workflows/**'
|
||||
|
||||
jobs:
|
||||
# ==========================================
|
||||
# 1. API
|
||||
# ==========================================
|
||||
deploy-api:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout kodu
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build API Image
|
||||
run: docker build -t sanstudent-api:latest -f Api/Dockerfile .
|
||||
|
||||
- name: Deploy API Container
|
||||
run: |
|
||||
docker rm -f api-container || true
|
||||
docker network create san-network || true
|
||||
docker run -d \
|
||||
--name api-container \
|
||||
--network san-network \
|
||||
-p 8083:8080 \
|
||||
-e ConnectionStrings__DefaultConnection="${{ secrets.DB_CONNECTION_STRING }}" \
|
||||
-e ConnectionStrings__RedisCache="${{ secrets.REDIS_CONNECTION_STRING }}" \
|
||||
--restart always \
|
||||
sanstudent-api:latest
|
||||
|
||||
# ==========================================
|
||||
# 2. FRONTADMIN (Blazor WebAssembly)
|
||||
# ==========================================
|
||||
deploy-frontadmin:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout kodu
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build FrontAdmin Image
|
||||
run: docker build -t sanstudent-frontadmin:latest -f FrontAdmin/Dockerfile .
|
||||
|
||||
- name: Deploy FrontAdmin Container
|
||||
run: |
|
||||
docker rm -f frontadmin-container || true
|
||||
docker run -d \
|
||||
--name frontadmin-container \
|
||||
-p 8081:80 \
|
||||
--restart always \
|
||||
sanstudent-frontadmin:latest
|
||||
|
||||
# ==========================================
|
||||
# 3. FRONTSTUDENT (Blazor WebAssembly)
|
||||
# ==========================================
|
||||
deploy-frontstudent:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout kodu
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build FrontStudent Image
|
||||
run: docker build -t sanstudent-frontstudent:latest -f FrontStudent/Dockerfile .
|
||||
|
||||
- name: Deploy FrontStudent Container
|
||||
run: |
|
||||
docker rm -f frontstudent-container || true
|
||||
docker run -d \
|
||||
--name frontstudent-container \
|
||||
-p 8082:80 \
|
||||
--restart always \
|
||||
sanstudent-frontstudent:latest
|
||||
Reference in New Issue
Block a user