Skip to content

Commit

Permalink
Merge pull request #450 from dump-hr/main
Browse files Browse the repository at this point in the history
sync 2024
  • Loading branch information
bdeak4 authored Dec 22, 2024
2 parents 8b088b4 + d9e802a commit 1163e50
Show file tree
Hide file tree
Showing 36 changed files with 1,025 additions and 21 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- '2024'

workflow_dispatch:

Expand All @@ -30,7 +31,7 @@ jobs:
run: yarn install --immutable

- name: Build frontend web apps
run: yarn build --filter=admin... --filter=sponsor... --filter=web...
run: yarn build --filter=admin... --filter=sponsor... --filter=web... --filter=app...

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -49,6 +50,7 @@ jobs:
file: ./apps/api/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }},
ghcr.io/${{ github.repository }}:${{ github.ref_name }},
ghcr.io/${{ github.repository }}:${{ github.ref_name == 'main' && 'latest' || 'unstable' }}
cache-from: type=gha
cache-to: type=gha,mode=max
Expand Down Expand Up @@ -90,4 +92,4 @@ jobs:
- name: Run Ansible playbook
run: |
eval $(ssh-agent)
./infrastructure/scripts/ansible-playbook.sh production api
./infrastructure/scripts/ansible-playbook.sh ${{ github.ref_name == 'main' && 'production' || github.ref_name }} api
6 changes: 3 additions & 3 deletions .github/workflows/docker-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches-ignore:
- main
- '2024'

workflow_dispatch:

Expand All @@ -30,7 +31,7 @@ jobs:
run: yarn install --immutable

- name: Build frontend web apps
run: yarn build --filter=admin... --filter=sponsor... --filter=web...
run: yarn build --filter=admin... --filter=sponsor... --filter=web... --filter=app...

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -48,7 +49,6 @@ jobs:
context: .
file: ./apps/api/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }},
ghcr.io/${{ github.repository }}:${{ github.ref_name == 'main' && 'latest' || 'unstable' }}
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
1 change: 1 addition & 0 deletions apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ COPY --from=installer --chown=nestjs:nestjs /app .
COPY --chown=nestjs:nestjs apps/admin/dist ./apps/admin/dist
COPY --chown=nestjs:nestjs apps/sponsor/dist ./apps/sponsor/dist
COPY --chown=nestjs:nestjs apps/web/dist ./apps/web/dist
COPY --chown=nestjs:nestjs apps/app/dist ./apps/app/dist

CMD node apps/api/dist/src/main.js
9 changes: 1 addition & 8 deletions apps/api/db/migrations/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@
"when": 1716132892106,
"tag": "0010_slimy_stature",
"breakpoints": true
},
{
"idx": 11,
"version": "5",
"when": 1732540348770,
"tag": "0011_narrow_clea",
"breakpoints": true
}
]
}
}
6 changes: 5 additions & 1 deletion apps/api/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ import { SurveyQuestionModule } from './survey-question/survey-question.module';
? [
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', '..', '..', 'web', 'dist'),
exclude: ['/api/(.*)', '/sponsor/(.*)', '/admin/(.*)'],
exclude: ['/api/(.*)', '/app/(.*)', '/sponsor/(.*)', '/admin/(.*)'],
}),
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', '..', '..', 'app', 'dist'),
serveRoot: '/app',
}),
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', '..', '..', 'sponsor', 'dist'),
Expand Down
10 changes: 9 additions & 1 deletion apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const setupProxies = (app: INestApplication) => {
(pathname: string) =>
!pathname.startsWith('/api') &&
!pathname.startsWith('/admin') &&
!pathname.startsWith('/sponsor'),
!pathname.startsWith('/sponsor') &&
!pathname.startsWith('/app'),
{ target: 'http://localhost:3004' },
),
);
Expand All @@ -57,6 +58,13 @@ const setupProxies = (app: INestApplication) => {
'/sponsor',
createProxyMiddleware({ target: 'http://localhost:3003' }),
);

app.use(
'/app',
createProxyMiddleware({
target: 'http://localhost:3005',
}),
);
}
};

Expand Down
10 changes: 10 additions & 0 deletions apps/app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ import path from 'path';
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
base: '/app',
server: {
port: 3005,
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
},
},
},
css: {
preprocessorOptions: {
scss: {
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Path } from './constants/paths';
import { getPageTitle } from './helpers';
import { Chatbot } from './pages/Chatbot';
import { LandingPage } from './pages/LandingPage';
import { TemporaryLandingPage } from './pages/TemporaryLandingPage';

export const App = () => {
return (
Expand All @@ -30,7 +31,8 @@ export const App = () => {
</Helmet>

<Switch>
<Route path={Path.Landing} component={LandingPage} />
<Route path={Path.Landing} component={TemporaryLandingPage} />
<Route path={Path.Test} component={LandingPage} />
<Route path={Path.Chatbot} component={Chatbot} />
</Switch>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
.title,
.sticker {
margin-right: 40px;
margin-top: 0;
z-index: 2;
}

Expand Down
Loading

0 comments on commit 1163e50

Please sign in to comment.