Skip to content

Commit

Permalink
Setupping CI/CD and infrastructure deploy for Next.js app
Browse files Browse the repository at this point in the history
  • Loading branch information
jurabek committed Feb 6, 2024
1 parent 4bdc962 commit ecd861c
Show file tree
Hide file tree
Showing 138 changed files with 52 additions and 27 deletions.
49 changes: 22 additions & 27 deletions .github/workflows/web-app.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,35 @@

name: web-app

on:
push:
branches:
- develop
- develop
paths:
- 'src/backend/web/web.client/web-app/**'
- '.github/workflows/web-app.yml'
- 'src/backend/services/web-app/**'
- '.github/workflows/web-app.yml'

pull_request:
branches:
- develop
- develop
paths:
- 'src/backend/web/web.client/web-app/**'
- '.github/workflows/web-app.yml'
- 'src/backend/services/web-app/**'
- '.github/workflows/web-app.yml'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
jobs:
build-release:
uses: ./.github/workflows/build-release.yml
with:
service-name: web-app
secrets: inherit

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '8.x'

- name: Install Packages
run: npm install
working-directory: ./src/backend/web/web.client/web-app/
deploy:
if: github.ref == 'refs/heads/develop'
needs:
- build-release
uses: ./.github/workflows/deploy.yml
with:
service-name: web-app
version: ${{ needs.build-release.outputs.new-version }}

- name: Build
run: npm run build --if-present
working-directory: ./src/backend/web/web.client/web-app/

env:
CI: true
1 change: 1 addition & 0 deletions k8s-kustomize/services/web-app/base/.secret.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXTAUTH_SECRET=948368824784ca1e83e260d55a04b734351b3e49336f639774f87f6846493a2b
6 changes: 6 additions & 0 deletions k8s-kustomize/services/web-app/base/config.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
API_BASE_URL=http://localost:80
NEXTAUTH_URL=http://localhost:80
AUTH_ISSUER=http://localhost:80/identity
AUTH_CLIENT_ID=nextjs-web-app
AUTH_CLIENT_SECRET=secret
OTEL_EXPORTER_OTLP_ENDPOINT=otel-collector.monitoring:4317
20 changes: 20 additions & 0 deletions k8s-kustomize/services/web-app/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- envs:
- config.env
name: web-app

secretGenerator:
- envs:
- .secret
name: web-app

images:
- name: web-app
newName: ghcr.io/chayxana/web-app
newTag: 0.0.0
2 changes: 2 additions & 0 deletions src/backend/services/web-app/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.next
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/backend/services/web-app/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.1

0 comments on commit ecd861c

Please sign in to comment.