Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 0886014

Browse files
authored
Merge pull request #71 from Pollak-Projects/development/AdminPage
Merge admin into landing for design
2 parents c7c3324 + 18cce5d commit 0886014

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3731
-2122
lines changed

.github/workflows/build.yml

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88

99

1010
jobs:
11-
build:
12-
name: Build and analyze
11+
analyze:
12+
name: Analyze
1313
runs-on: ubuntu-latest
1414

1515
steps:
@@ -26,3 +26,80 @@ jobs:
2626
# timeout-minutes: 5
2727
# env:
2828
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
29+
build-frontend:
30+
name: Build Frontend Docker Image 🏗️
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Check out repository code 🛎️
35+
uses: actions/checkout@v4
36+
with:
37+
sparse-checkout: CourseController
38+
39+
- name: Set up QEMU 🐳
40+
uses: docker/setup-qemu-action@v2
41+
42+
- name: Set up Docker Buildx 🚀
43+
uses: docker/setup-buildx-action@v3
44+
45+
- name: Login to Registry 🚢
46+
uses: docker/login-action@v3
47+
with:
48+
registry: ghcr.io
49+
username: ${{ github.actor }}
50+
password: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Build and push 🏗️
53+
uses: docker/build-push-action@v2
54+
with:
55+
context: ./CourseController
56+
platforms: linux/amd64
57+
file: ./CourseController/Dockerfile
58+
push: true
59+
tags: ghcr.io/pollak-projects/szf1_13_frontend_coursecontroller/app:latest
60+
cache-from: type=gha
61+
cache-to: type=gha,mode=max
62+
63+
build-backend:
64+
name: Build Backend Docker Image 🏗️
65+
runs-on: ubuntu-latest
66+
67+
steps:
68+
- name: Check out repository code 🛎️
69+
uses: actions/checkout@v4
70+
with:
71+
sparse-checkout: server
72+
73+
- name: Set up QEMU 🐳
74+
uses: docker/setup-qemu-action@v2
75+
76+
- name: Set up Docker Buildx 🚀
77+
uses: docker/setup-buildx-action@v3
78+
79+
- name: Login to Registry 🚢
80+
uses: docker/login-action@v3
81+
with:
82+
registry: ghcr.io
83+
username: ${{ github.actor }}
84+
password: ${{ secrets.GITHUB_TOKEN }}
85+
86+
- name: Build and push 🏗️
87+
uses: docker/build-push-action@v2
88+
with:
89+
context: ./server
90+
platforms: linux/amd64
91+
file: ./server/Dockerfile
92+
push: true
93+
tags: ghcr.io/pollak-projects/szf1_13_frontend_coursecontroller/api:latest
94+
cache-from: type=gha
95+
cache-to: type=gha,mode=max
96+
97+
triggerUpdate:
98+
name: Trigger Update 🔄
99+
runs-on: ubuntu-latest
100+
needs: [build-backend, build-frontend]
101+
steps:
102+
- name: Call Webhook
103+
uses: distributhor/workflow-webhook@v3
104+
with:
105+
webhook_url: ${{ secrets.WEBHOOK_URL }}

CourseController/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_API_URL=http://localhost:3300

CourseController/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ node_modules
1111
dist
1212
dist-ssr
1313
*.local
14+
.env
1415

1516
# Editor directories and files
1617
.vscode/*

CourseController/.run/dev.run.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="dev" type="js.build_tools.npm" nameIsGenerated="true">
3+
<package-json value="$PROJECT_DIR$/package.json" />
4+
<command value="run" />
5+
<scripts>
6+
<script value="dev" />
7+
</scripts>
8+
<node-interpreter value="project" />
9+
<envs />
10+
<method v="2" />
11+
</configuration>
12+
</component>

CourseController/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# it's a good idea to pin this, but for demo purposes we'll leave it as is
2+
FROM node:latest as builder
3+
4+
# automatically creates the dir and sets it as the current working dir
5+
WORKDIR /usr/src/app
6+
# this will allow us to run vite and other tools directly
7+
ENV PATH /usr/src/node_modules/.bin:$PATH
8+
9+
# inject all environment vars we'll need
10+
ARG VITE_BACKEND_URL
11+
# expose the variable to the finished cotainer
12+
ENV VITE_BACKEND_URL=$VITE_BACKEND_URL
13+
14+
COPY ./package.json ./
15+
16+
RUN npm install
17+
18+
# use a more specific COPY, as this will include files like `Dockerfile`, we don't really need inside our containers.
19+
COPY ./ ./
20+
21+
FROM builder as dev
22+
CMD ["npm", "run", "dev"]
23+
24+
FROM builder as prod-builder
25+
RUN npm run build
26+
27+
# it's a good idea to pin this, but for demo purposes we'll leave it as is
28+
FROM nginx:latest as prod
29+
30+
COPY --from=prod-builder /usr/src/app/dist /usr/share/nginx/html
31+
32+
COPY ./config/nginx.conf /etc/nginx/conf.d/default.conf
33+
34+
CMD ["nginx", "-g", "daemon off;"]

CourseController/components.d.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ export {}
77
/* prettier-ignore */
88
declare module 'vue' {
99
export interface GlobalComponents {
10-
AdminModule: typeof import('./src/components/AdminModule.vue')['default']
11-
AdminNavbar: typeof import('./src/components/AdminNavbar.vue')['default']
10+
AdminModule: typeof import('./src/components/AdminComponents/AdminModule.vue')['default']
11+
AdminNavbar: typeof import('./src/components/AdminComponents/AdminNavbar.vue')['default']
1212
Button: typeof import('primevue/button')['default']
13+
Toast: typeof import('primevue/toast')['default']
14+
Feladatsor: typeof import('./src/components/ViewComponents/Feladatsor.vue')['default']
1315
Menu: typeof import('primevue/menu')['default']
14-
Navigation: typeof import('./src/components/Navigation.vue')['default']
16+
Navigation: typeof import('./src/components/NavigationComponents/Navigation.vue')['default']
1517
RouterLink: typeof import('vue-router')['RouterLink']
1618
RouterView: typeof import('vue-router')['RouterView']
17-
UserIcon: typeof import('./src/components/UserIcon.vue')['default']
19+
UserIcon: typeof import('./src/components/NavigationComponents/UserIcon.vue')['default']
20+
View: typeof import('./src/components/ViewComponents/View.vue')['default']
1821
}
1922
}

CourseController/config/nginx.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
server {
2+
listen 80;
3+
4+
location / {
5+
root /usr/share/nginx/html;
6+
index index.html index.htm;
7+
try_files $uri $uri/ /index.html;
8+
}
9+
}

0 commit comments

Comments
 (0)