mirror of
https://github.com/valitydev/dashboard.git
synced 2024-11-06 02:25:23 +00:00
TECHDEBT-36: Add CI check and build (#9)
This commit is contained in:
parent
918c43bd3d
commit
b49f6f8a27
18
.github/actions/init/action.yaml
vendored
Normal file
18
.github/actions/init/action.yaml
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
name: Init
|
||||||
|
description: Init
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Init NodeJS
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '16.13.2'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
run: npm ci
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Generate Swagger & OpenAPI code
|
||||||
|
run: npm run codegen
|
||||||
|
shell: bash
|
33
.github/workflows/build-push.yaml
vendored
Normal file
33
.github/workflows/build-push.yaml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: Build & Push
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'main'
|
||||||
|
env:
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Init
|
||||||
|
uses: ./.github/actions/init
|
||||||
|
|
||||||
|
- name: Check & Build
|
||||||
|
run: npm run ci:build
|
||||||
|
|
||||||
|
- name: Deploy image
|
||||||
|
uses: valitydev/action-deploy-docker@v1.0.16
|
||||||
|
with:
|
||||||
|
registry-username: ${{ github.actor }}
|
||||||
|
registry-access-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
dockerfile-path: .
|
||||||
|
env:
|
||||||
|
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
22
.github/workflows/pr-build-check.yaml
vendored
Normal file
22
.github/workflows/pr-build-check.yaml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: 'PR: Build & Check'
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: ['*']
|
||||||
|
env:
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Init
|
||||||
|
uses: ./.github/actions/init
|
||||||
|
|
||||||
|
- name: Check & Build
|
||||||
|
run: npm run ci:build
|
18
.github/workflows/pr.yaml
vendored
18
.github/workflows/pr.yaml
vendored
@ -1,13 +1,13 @@
|
|||||||
name: 'PR Title Checker'
|
name: 'PR Title Checker'
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [edited, opened, synchronize, reopened]
|
types: [edited, opened, synchronize, reopened]
|
||||||
branches: [disabled]
|
branches: [disabled]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
title-check:
|
title-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: naveenk1223/action-pr-title@master
|
- uses: naveenk1223/action-pr-title@master
|
||||||
with:
|
with:
|
||||||
regex: '([A-Z]+-[0-9]+,?)+: [A-Z0-9].*'
|
regex: '([A-Z]+-[0-9]+,?)+: [A-Z0-9].*'
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
<component name="PrettierConfiguration">
|
<component name="PrettierConfiguration">
|
||||||
<option name="myRunOnSave" value="true" />
|
<option name="myRunOnSave" value="true" />
|
||||||
<option name="myRunOnReformat" value="true" />
|
<option name="myRunOnReformat" value="true" />
|
||||||
<option name="myFilesPattern" value="{**/*,*}.{js,ts,jsx,tsx,md,json,html,svg,scss,css}" />
|
<option name="myFilesPattern" value="{**/*,*}.{js,ts,jsx,tsx,md,json,html,svg,scss,css,yml,yaml}" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -8,4 +8,6 @@ src/app/**/swagger-codegen
|
|||||||
src/app/**/openapi-codegen
|
src/app/**/openapi-codegen
|
||||||
src/app/**/gen-model
|
src/app/**/gen-model
|
||||||
.vscode
|
.vscode
|
||||||
.swagger-codegen
|
.idea
|
||||||
|
.swagger-codegen
|
||||||
|
.angular
|
3
Dockerfile
Normal file
3
Dockerfile
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM nginx:1.21
|
||||||
|
COPY dist /usr/share/nginx/html
|
||||||
|
COPY nginx.conf /etc/nginx/vhosts.d/dashboard.conf
|
10
package.json
10
package.json
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "dashboard",
|
"name": "dashboard",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "ngcc",
|
"postinstall": "ngcc",
|
||||||
"start": "ng serve --port 8000",
|
"start": "ng serve --port 8000",
|
||||||
@ -14,20 +15,19 @@
|
|||||||
"lint": "npm run lint-cache-cmd",
|
"lint": "npm run lint-cache-cmd",
|
||||||
"lint-fix": "npm run lint-cache-cmd -- --fix",
|
"lint-fix": "npm run lint-cache-cmd -- --fix",
|
||||||
"lint-errors": "npm run lint-cache-cmd -- --quiet",
|
"lint-errors": "npm run lint-cache-cmd -- --quiet",
|
||||||
"prettier-cmd": "prettier \"**/*.{html,js,ts,css,scss,md,json,prettierrc,svg}\"",
|
"prettier-cmd": "prettier \"**/*.{html,js,ts,css,scss,md,json,prettierrc,svg,yaml,yml}\"",
|
||||||
"prettier": "npm run prettier-cmd -- --check",
|
"prettier": "npm run prettier-cmd -- --check",
|
||||||
"prettier-fix": "npm run prettier-cmd -- --write",
|
"prettier-fix": "npm run prettier-cmd -- --write",
|
||||||
"tools-cmd": "ts-node --project tools/tsconfig.json",
|
"tools-cmd": "ts-node --project tools/tsconfig.json",
|
||||||
"parallel-cmd": "concurrently --prefix-colors magenta,green",
|
"parallel-cmd": "concurrently --kill-others-on-fail --prefix-colors magenta,green,red,yellow,blue",
|
||||||
"swagger-codegen": "npm run tools-cmd -- tools/swagger-codegen.ts",
|
"swagger-codegen": "npm run tools-cmd -- tools/swagger-codegen.ts",
|
||||||
"openapi-codegen": "openapi-generator-cli version && npm run tools-cmd -- tools/openapi-codegen.ts",
|
"openapi-codegen": "openapi-generator-cli version && npm run tools-cmd -- tools/openapi-codegen.ts",
|
||||||
"codegen": "npm run parallel-cmd -- --names SWAG,OAPI \"npm run swagger-codegen\" \"npm run openapi-codegen\"",
|
"codegen": "npm run parallel-cmd -- --names SWAG,OAPI \"npm run swagger-codegen\" \"npm run openapi-codegen\"",
|
||||||
"icons-list-gen": "npm run tools-cmd -- tools/gen-icons-list.ts",
|
"icons-list-gen": "npm run tools-cmd -- tools/gen-icons-list.ts",
|
||||||
"icons-ids-gen": "npm run tools-cmd -- tools/gen-icons-ids.ts",
|
"icons-ids-gen": "npm run tools-cmd -- tools/gen-icons-ids.ts",
|
||||||
"ci:check": "npm run parallel-cmd -- --names PRET,LINT \"npm run prettier\" \"npm run lint-cmd -- --quiet\"",
|
"ci:test": "npm run test -- --configuration=ci",
|
||||||
"ci:test": "npm run test -- --configuration=ci"
|
"ci:build": "npm run parallel-cmd -- --names PRETTIER,LINT,BUILD \"npm run prettier\" \"npm run lint-cmd -- --quiet\" \"npm run build\""
|
||||||
},
|
},
|
||||||
"private": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "~13.1.1",
|
"@angular/animations": "~13.1.1",
|
||||||
"@angular/cdk": "~13.1.1",
|
"@angular/cdk": "~13.1.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user