-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
176 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: CI | ||
|
||
#env: | ||
# JDK_JAVA_OPTIONS: --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED | ||
# MAVEN_USERNAME: ch4mpy | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'maven' | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Make Maven Wrapper executable | ||
if: contains(matrix.os, 'win') == false | ||
run: chmod +x ./api/mvnw | ||
|
||
- name: Build with Maven | ||
run: | | ||
cd ./api | ||
./mvnw clean install -Popenapi,h2 | ||
./mvnw spring-boot:build-image -DskipTests | ||
- name: Set VERSION environment variable | ||
run: | | ||
cd ./api | ||
echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker Tag-Push gateway ${{ env.VERSION }} | ||
run: | | ||
docker tag bff:${{ env.VERSION }} ${{ secrets.DOCKERHUB_USERNAME }}/quiz-bff | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/quiz-bff | ||
- name: Docker Tag-Push API ${{ env.VERSION }} | ||
run: | | ||
docker tag quiz-api:${{ env.VERSION }} ${{ secrets.DOCKERHUB_USERNAME }}/quiz-api | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/quiz-api | ||
- name: Docker Build-Tag-Push Angular UI | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./angular-ui | ||
file: ./angular-ui/Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/quiz-ui | ||
|
||
- name: Rollout Restart OVH quiz | ||
run: | | ||
mkdir ${HOME}/.kube | ||
echo ${{ secrets.OVH_KUBECONFIG }} | base64 --decode > ${HOME}/.kube/config | ||
kubectl config use-context kubernetes-admin@c4-staging | ||
kubectl rollout restart -n quiz deployment.apps/quiz-ui deployment.apps/bff deployment.apps/quiz-api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Stage 1 | ||
FROM node:18 as node | ||
COPY ./ /usr/local/app | ||
WORKDIR /usr/local/app | ||
RUN apt-get update && apt-get install -y openjdk-17-jre | ||
RUN npm install | ||
RUN npm run build | ||
|
||
# Stage 2 | ||
FROM nginx | ||
COPY --from=node /usr/local/app/dist/quiz/* /usr/share/nginx/html/ui/ | ||
COPY nginx.conf /etc/nginx/nginx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
events{} | ||
|
||
http { | ||
|
||
include /etc/nginx/mime.types; | ||
|
||
server { | ||
listen 80; | ||
server_name localhost; | ||
root /usr/share/nginx/html; | ||
location /ui/ { | ||
try_files $uri $uri/ /ui/index.html; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ encoder.ts | |
git_push.sh | ||
index.ts | ||
karma.conf.js | ||
package.json | ||
package-lock.json | ||
param.ts | ||
README.md | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "@c4-soft/bff-api", | ||
"version": "0.0.1", | ||
"peerDependencies": { | ||
"@angular/common": "^16.0.0", | ||
"@angular/core": "^16.0.0" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.3.0" | ||
}, | ||
"sideEffects": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ encoder.ts | |
git_push.sh | ||
index.ts | ||
karma.conf.js | ||
package.json | ||
package-lock.json | ||
param.ts | ||
README.md | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "@c4-soft/quiz-api", | ||
"version": "0.0.1", | ||
"peerDependencies": { | ||
"@angular/common": "^16.0.0", | ||
"@angular/core": "^16.0.0" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.3.0" | ||
}, | ||
"sideEffects": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.