82 lines
2.5 KiB
YAML
82 lines
2.5 KiB
YAML
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 sanstudent-api-container || true
|
|
docker network create san-network || true
|
|
docker run -d \
|
|
--name sanstudent-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 sanstudent-admin-container || true
|
|
docker run -d \
|
|
--name sanstudent-admin-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 sanstudent-student-container || true
|
|
docker run -d \
|
|
--name sanstudent-student-container \
|
|
-p 8082:80 \
|
|
--restart always \
|
|
sanstudent-frontstudent:latest |