-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '116-frontend-add-unit-testing-for-frontend' into vitest…
…-branch
- Loading branch information
Showing
9,200 changed files
with
1,684,756 additions
and
636 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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 |
---|---|---|
@@ -1,69 +0,0 @@ | ||
name: "Containers: Publish" | ||
|
||
on: | ||
push: | ||
tags: ["v*"] | ||
|
||
permissions: | ||
packages: write | ||
|
||
jobs: | ||
release-containers: | ||
name: Build and Push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Login to ghcr.io Docker registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Compute Docker container image addresses | ||
run: | | ||
DOCKER_REPOSITORY="ghcr.io/${GITHUB_REPOSITORY,,}" | ||
DOCKER_TAG="${GITHUB_REF:11}" | ||
echo "DOCKER_REPOSITORY=${DOCKER_REPOSITORY}" >> $GITHUB_ENV | ||
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV | ||
echo "Using: ${DOCKER_REPOSITORY}/*:${DOCKER_TAG}" | ||
# - name: 'Pull previous Docker container image: :latest' | ||
# run: docker pull "${DOCKER_REPOSITORY}:latest" || true | ||
|
||
- name: "Pull previous Docker container image: frontend-static:latest" | ||
run: docker pull "${DOCKER_REPOSITORY}/frontend-static:latest" || true | ||
|
||
- name: "Build Docker container image: frontend-static:latest" | ||
run: | | ||
docker build \ | ||
--cache-from "${DOCKER_REPOSITORY}/frontend-static:latest" \ | ||
--file frontend/Dockerfile.demo \ | ||
--build-arg SERVER_NAME=localhost \ | ||
--tag "${DOCKER_REPOSITORY}/frontend-static:latest" \ | ||
--tag "${DOCKER_REPOSITORY}/frontend-static:${DOCKER_TAG}" \ | ||
frontend | ||
- name: "Push Docker container image frontend-static:latest" | ||
run: docker push "${DOCKER_REPOSITORY}/frontend-static:latest" | ||
|
||
- name: "Push Docker container image frontend-static:v*" | ||
run: docker push "${DOCKER_REPOSITORY}/frontend-static:${DOCKER_TAG}" | ||
# | ||
# | ||
# - name: 'Build Docker container image: backend:latest' | ||
# run: | | ||
# cd backend && \ | ||
# make && \ | ||
# docker image tag "${DOCKER_REPOSITORY}/backend/local:latest" "${DOCKER_REPOSITORY}/backend:latest" | ||
# | ||
# - name: Push Docker container image backend:latest | ||
# run: docker push "${DOCKER_REPOSITORY}/backend:latest" | ||
# | ||
# - name: Push Docker container image backend:v* | ||
# run: docker push "${DOCKER_REPOSITORY}/backend:${DOCKER_TAG}" | ||
|
||
# - name: Push Docker container image :v*" | ||
# run: docker push "${DOCKER_REPOSITORY}:${DOCKER_TAG}" | ||
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 |
---|---|---|
@@ -1,18 +0,0 @@ | ||
name: "Release: Prepare PR" | ||
|
||
on: | ||
push: | ||
branches: [develop] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
release-prepare: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: JarvusInnovations/infra-components@channels/github-actions/release-prepare/latest | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
release-branch: main | ||
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 |
---|---|---|
@@ -1,14 +0,0 @@ | ||
name: "Release: Publish PR" | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [closed] | ||
|
||
jobs: | ||
release-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: JarvusInnovations/infra-components@channels/github-actions/release-publish/latest | ||
with: | ||
github-token: ${{ secrets.BOT_GITHUB_TOKEN }} | ||
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 |
---|---|---|
@@ -1,14 +0,0 @@ | ||
name: "Release: Validate PR" | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [opened, edited, reopened, synchronize] | ||
|
||
jobs: | ||
release-validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: JarvusInnovations/infra-components@channels/github-actions/release-validate/latest | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
Empty file.
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,8 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', { targets: { node: 'current' } }], | ||
'@babel/preset-typescript', | ||
'@babel/preset-react', | ||
], | ||
}; | ||
|
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 @@ | ||
gateway: 192.168.0.1 |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,5 +24,3 @@ config/env/env.dev | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.DS_Store |
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,38 @@ | ||
# This dockerfile builds an image for a static frontend only server suitable for online hosting. | ||
# Use the official Node.js image as the base image | ||
FROM node:18 as builder | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /usr/src/app | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package*.json ./ | ||
|
||
# Set version number | ||
ARG FRONTEND_VERSION | ||
RUN npm version $FRONTEND_VERSION | ||
|
||
# Install dependencies | ||
RUN npm ci --legacy-peer-deps | ||
|
||
# Copy project files | ||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
FROM alpine:latest as nginx-config | ||
RUN apk --no-cache add gettext | ||
WORKDIR /app | ||
COPY nginx.conf.demo ./nginx.conf.demo | ||
# This will get overwritten by helm chart | ||
|
||
ARG SERVER_NAME | ||
ENV SERVER_NAME $SERVER_NAME | ||
RUN cat nginx.conf.demo | envsubst > nginx.conf | ||
|
||
FROM nginx:alpine | ||
|
||
COPY --from=nginx-config /app/nginx.conf /etc/nginx/nginx.conf | ||
COPY --from=Builder /usr/src/app/dist /usr/share/nginx/html | ||
|
||
# The default entrypoint works for us. |
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,16 @@ | ||
version: "3.8" | ||
services: | ||
frontend-static: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.demo | ||
args: | ||
- IMAGE_NAME=frontend-static | ||
- FRONTEND_VERSION=0.0.2 | ||
- SERVER_NAME=localhost | ||
image: ghcr.io/codeforphilly/balancer-main/frontend-static:0.0.2 | ||
ports: | ||
- "80:80" | ||
environment: | ||
- CHOKIDAR_USEPOLLING=true | ||
- VITE_API_BASE_URL=https://devnull-as-a-service.com/dev/null |
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 @@ | ||
version: "3.8" | ||
services: | ||
react-app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
args: | ||
- IMAGE_NAME=balancer-frontend-dev | ||
ports: | ||
- "3000:3000" | ||
# The port number is hard-coded, located in ./vite.config.ts | ||
environment: | ||
- CHOKIDAR_USEPOLLING=true | ||
volumes: | ||
- "./:/usr/src/app:delegated" | ||
- "./node_modules:/usr/src/app/node_modules/" |
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,29 @@ | ||
# nginx config file for static frontend demo site. | ||
# This will be the nginx.conf in the docker image before it gets overwritten by kubernetes helm chart. | ||
user nginx; | ||
worker_processes 1; | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
include /etc/nginx/mime.types; | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
server_name $SERVER_NAME; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
} | ||
|
||
#error_page 404 /404.html; | ||
|
||
# redirect server error pages to the static page /50x.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,6 @@ | ||
export const getEnv = () => { | ||
return { | ||
apiUrl: import.meta.env.VITE_API_BASE_URL, | ||
}; | ||
}; | ||
|
Oops, something went wrong.