File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build and Push Backend
2+
3+ on :
4+ push :
5+ branches : [main]
6+ paths :
7+ - ' Backend/**'
8+ - ' Dockerfile.backend'
9+
10+ env :
11+ IMAGE_NAME : ghcr.io/oss-slu/oss_dev_analytics/backend
12+
13+ jobs :
14+ build-and-push :
15+ runs-on : ubuntu-latest
16+ permissions :
17+ contents : read
18+ packages : write
19+ steps :
20+ - uses : actions/checkout@v4
21+
22+ - uses : docker/login-action@v3
23+ with :
24+ registry : ghcr.io
25+ username : ${{ github.actor }}
26+ password : ${{ secrets.GITHUB_TOKEN }}
27+
28+ - id : meta
29+ uses : docker/metadata-action@v5
30+ with :
31+ images : ${{ env.IMAGE_NAME }}
32+ tags : |
33+ type=sha,prefix=,format=short
34+ type=raw,value=latest,enable={{is_default_branch}}
35+
36+ - uses : docker/build-push-action@v5
37+ with :
38+ context : .
39+ file : Dockerfile.backend
40+ push : true
41+ tags : ${{ steps.meta.outputs.tags }}
Original file line number Diff line number Diff line change 1+ name : Build and Push Frontend
2+
3+ on :
4+ push :
5+ branches : [main]
6+ paths :
7+ - ' Frontend/**'
8+ - ' Dockerfile.frontend'
9+ - ' nginx.conf'
10+
11+ env :
12+ IMAGE_NAME : ghcr.io/oss-slu/oss_dev_analytics/frontend
13+
14+ jobs :
15+ build-and-push :
16+ runs-on : ubuntu-latest
17+ permissions :
18+ contents : read
19+ packages : write
20+ steps :
21+ - uses : actions/checkout@v4
22+
23+ - uses : docker/login-action@v3
24+ with :
25+ registry : ghcr.io
26+ username : ${{ github.actor }}
27+ password : ${{ secrets.GITHUB_TOKEN }}
28+
29+ - id : meta
30+ uses : docker/metadata-action@v5
31+ with :
32+ images : ${{ env.IMAGE_NAME }}
33+ tags : |
34+ type=sha,prefix=,format=short
35+ type=raw,value=latest,enable={{is_default_branch}}
36+
37+ - uses : docker/build-push-action@v5
38+ with :
39+ context : .
40+ file : Dockerfile.frontend
41+ push : true
42+ tags : ${{ steps.meta.outputs.tags }}
Original file line number Diff line number Diff line change 1+ FROM python:3.11-slim
2+
3+ WORKDIR /app
4+
5+ COPY docs/requirements.txt ./requirements.txt
6+ RUN pip install --no-cache-dir -r requirements.txt
7+
8+ COPY Backend/ ./Backend/
9+ COPY data/ ./data/
10+
11+ ENV DATA_PATH=/data/sprint_data.json
12+ ENV OUTPUT_PATH=/data/health.json
Original file line number Diff line number Diff line change 1+ FROM node:20-alpine AS builder
2+
3+ WORKDIR /app
4+
5+ COPY Frontend/package*.json ./
6+ RUN npm ci
7+
8+ COPY Frontend/ ./
9+ RUN npm run build
10+
11+ FROM nginx:alpine
12+ COPY --from=builder /app/dist /usr/share/nginx/html
13+ COPY nginx.conf /etc/nginx/conf.d/default.conf
14+
15+ EXPOSE 80
Original file line number Diff line number Diff line change 1+ server {
2+ listen 80 ;
3+ server_name _;
4+ root /usr/share/nginx/html;
5+ index index .html;
6+
7+ location /data/ {
8+ alias /usr/share/nginx/html/data/;
9+ add_header Cache-Control "no-cache" ;
10+ }
11+
12+ location / {
13+ try_files $uri $uri / /index .html;
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments