Skip to content

Commit 9a1ac07

Browse files
added research assistant code
1 parent 1bae672 commit 9a1ac07

File tree

3 files changed

+41
-17
lines changed

3 files changed

+41
-17
lines changed

.github/workflows/buid-docker-image.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,54 @@ name: Build Docker Images
33
on:
44
push:
55
branches: [main]
6+
paths:
7+
- ClientAdvisor/**
8+
- ResearchAssistant/**
69
pull_request:
710
branches: [main]
811
types:
912
- opened
1013
- ready_for_review
1114
- reopened
1215
- synchronize
16+
paths:
17+
- ClientAdvisor/**
18+
- ResearchAssistant/**
1319
merge_group:
1420

1521
jobs:
1622
docker-build:
23+
runs-on: ubuntu-latest
1724
strategy:
1825
matrix:
1926
include:
2027
- app_name: clientadvisor-webapp
2128
dockerfile: ClientAdvisor/App/WebApp.Dockerfile
29+
registry: pslpricicdcontainerreg.azurecr.io
30+
username_secret: DOCKER_USERNAME
31+
password_secret: DOCKER_PASSWORD
2232
- app_name: clientadvisor-azurefunction
2333
dockerfile: ClientAdvisor/AzureFunction/Dockerfile
34+
registry: pslpricicdcontainerreg.azurecr.io
35+
username_secret: DOCKER_USERNAME
36+
password_secret: DOCKER_PASSWORD
37+
- app_name: researchassistant-webapp
38+
dockerfile: ResearchAssistant/App/WebApp.Dockerfile
39+
registry: pslpriracontainerreg.azurecr.io
40+
username_secret: DOCKER_USERNAME_RESEARCHASSISTANT
41+
password_secret: DOCKER_PASSWORD_RESEARCHASSISTANT
2442

25-
uses: ./.github/workflows/build-docker.yml
26-
with:
27-
registry: pslpricicdcontainerreg.azurecr.io
28-
username: pslpricicdcontainerreg
29-
app_name: ${{ matrix.app_name }}
30-
dockerfile: ${{ matrix.dockerfile }}
31-
push: true # Adjust this logic as necessary
32-
secrets: inherit
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
47+
- name: Build and push Docker image
48+
uses: ./.github/workflows/build-docker.yml
49+
with:
50+
registry: ${{ matrix.registry }}
51+
username: ${{ secrets[matrix.username_secret] }}
52+
password: ${{ secrets[matrix.password_secret] }}
53+
app_name: ${{ matrix.app_name }}
54+
dockerfile: ${{ matrix.dockerfile }}
55+
push: true # Adjust this logic as necessary
56+
secrets: inherit

.github/workflows/build-docker.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
username:
1010
required: true
1111
type: string
12+
password_secret:
13+
required: true
14+
type: string
1215
app_name:
1316
required: true
1417
type: string
@@ -20,7 +23,7 @@ on:
2023
type: boolean
2124
secrets:
2225
DOCKER_PASSWORD:
23-
required: false
26+
required: true
2427

2528
jobs:
2629
docker-build:
@@ -30,16 +33,13 @@ jobs:
3033
- name: Checkout
3134
uses: actions/checkout@v4
3235

33-
- name: List Directory Contents
34-
run: ls -R
35-
3636
- name: Docker Login
3737
if: ${{ inputs.push }}
3838
uses: docker/login-action@v3
3939
with:
4040
registry: ${{ inputs.registry }}
4141
username: ${{ inputs.username }}
42-
password: ${{ secrets.DOCKER_PASSWORD }}
42+
password: ${{ secrets[inputs.password_secret] }}
4343

4444
- name: Set up Docker Buildx
4545
uses: docker/setup-buildx-action@v3

ResearchAssistant/App/WebApp.Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ FROM node:20-alpine AS frontend
22
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
33

44
WORKDIR /home/node/app
5-
COPY ./frontend/package*.json ./
5+
COPY ./ResearchAssistant/App/frontend/package*.json ./
66
USER node
77
RUN npm ci
8-
COPY --chown=node:node ./frontend/ ./frontend
8+
COPY --chown=node:node ./ResearchAssistant/App/frontend/ ./frontend
99
# COPY --chown=node:node ./static/ ./static
1010
WORKDIR /home/node/app/frontend
1111
RUN npm run build
@@ -20,12 +20,12 @@ RUN apk add --no-cache --virtual .build-deps \
2020
libpq \
2121
&& pip install --no-cache-dir uwsgi
2222

23-
COPY requirements.txt /usr/src/app/
23+
COPY ./ResearchAssistant/App/requirements.txt /usr/src/app/
2424
RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt \
2525
&& rm -rf /root/.cache
2626

2727
COPY . /usr/src/app/
2828
COPY --from=frontend /home/node/app/static /usr/src/app/static/
2929
WORKDIR /usr/src/app
3030
EXPOSE 80
31-
CMD ["uwsgi", "--http", ":80", "--wsgi-file", "app.py", "--callable", "app", "-b","32768"]
31+
CMD ["uwsgi", "--http", ":80", "--wsgi-file", "app.py", "--callable", "app", "-b","32768"]

0 commit comments

Comments
 (0)