Skip to content

Commit

Permalink
Add pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamid committed Nov 30, 2023
1 parent 95fb850 commit de2c4ad
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
day: friday
time: "10:00"
timezone: Europe/London
open-pull-requests-limit: 10
36 changes: 36 additions & 0 deletions .github/workflows/client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Client Build

on:
workflow_dispatch:
push:
branches:
- main

pull_request:
branches: [ "main" ]

jobs:

build:
runs-on: ubuntu-latest
timeout-minutes: 10

env:
DOCKER_BUILDKIT: 1

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build
run: docker build -o ./artifacts/test-results --target test-result .

- name: Publish Test Results
uses: actions/[email protected]
with:
name: TestReport
path: ./artifacts/test-results/

# - name: Build
# if: github.ref == 'refs/heads/main'
# run: docker build -t image . && docker save image -o artifacts\image.tar
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:20.10.0-slim as build

RUN apt-get update && apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb jq -y

WORKDIR /app

COPY package*.json ./
RUN npm ci

COPY . .
RUN npm run lint && npm run build

FROM build as test
RUN npm run test-component:headless && npm run test-e2e:headless

FROM scratch as test-result
COPY --from=test /app/coverage /

FROM nginx:1.25-alpine-slim as deployment
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
CMD ["/bin/sh", "-c", "nginx -g 'daemon off;'"]
COPY --from=build /app/dist /usr/share/nginx/html
23 changes: 23 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
server {
gzip on;
gzip_static on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
gunzip on;
http2 on;
listen 80;
server_name _;

root /usr/share/nginx/html;

location ~* ^.+\.map$ {
deny all;
return 404;
}

location / {
try_files $uri $uri/ /index.html;
}
}
1 change: 1 addition & 0 deletions src/router.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react-refresh/only-export-components */
import { lazy, Suspense } from 'react';
import { createBrowserRouter } from 'react-router-dom';
import RootLayout from 'pages/layout';
Expand Down

0 comments on commit de2c4ad

Please sign in to comment.