-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1923 from opengovern/ui-changes
feat: adding web ui
- Loading branch information
Showing
4 changed files
with
115 additions
and
1 deletion.
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,77 @@ | ||
name: NodeJS with Webpack | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
deployTo: | ||
type: choice | ||
description: "Environment to deploy to" | ||
options: | ||
- "dev" | ||
- "prod" | ||
default: "dev" | ||
push: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
environment: web | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: GitHub Tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Use Node.js 20.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: NPM Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.npm | ||
~/.cache | ||
./node_modules | ||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-npm- | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build | ||
env: | ||
CI: false | ||
run: npm run build | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GHCR_PAT }} | ||
- name: Build and push Docker images | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
platforms: linux/amd64,linux/arm64 # Add multi-platform support | ||
|
||
tags: | ||
ghcr.io/${{ github.repository_owner }}/web-ui:${{ steps.tag_version.outputs.new_tag }}-${{ github.event.inputs.deployTo == '' && 'dev' || github.event.inputs.deployTo }} | ||
file: docker/WebUiDockerfile | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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 |
---|---|---|
|
@@ -9,7 +9,6 @@ build/* | |
cache/* | ||
|
||
# Environment files | ||
*.env | ||
|
||
# PEM files | ||
*.pem | ||
|
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,22 @@ | ||
server { | ||
|
||
listen 7298; | ||
|
||
# This block is to catch workspaces and redirect to workspace/dashboard | ||
# location ~ ^(/(?!invitation|login|sign-up|workspaces))[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$ { | ||
# rewrite ^((/(?!invitation|login|sign-up|workspaces))[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$) $1/dashboard redirect; | ||
# } | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
|
||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
} |
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,16 @@ | ||
# Prepare nginx | ||
FROM docker.io/nginx:1.25.0-alpine | ||
COPY ./build /usr/share/nginx/html | ||
COPY ./.env.example /usr/share/nginx/html/.env | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
COPY ./assets/web-ui/nginx.conf /etc/nginx/conf.d | ||
|
||
RUN apk add --update npm | ||
RUN npm i -g [email protected] | ||
|
||
WORKDIR /usr/share/nginx/html | ||
|
||
# Fire up nginx | ||
EXPOSE 7298 | ||
#CMD ["nginx", "-g", "daemon off;"] | ||
CMD ["/bin/sh", "-c", "runtime-env-cra && nginx -g \"daemon off;\""] |