TECHDEBT-28: Add deploy (#6)

This commit is contained in:
Rinat Arsaev 2022-01-12 15:49:47 +03:00 committed by GitHub
parent e95b439730
commit 0231bf5d9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 89 additions and 54 deletions

21
.github/actions/init/action.yaml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Init
description: Init
runs:
using: composite
steps:
- name: Init Thrift
uses: valitydev/action-setup-thrift@v0.0.1
- name: Init NodeJS
uses: actions/setup-node@v2
with:
node-version: '16.4.2'
cache: 'npm'
- name: Install Packages
run: npm ci
shell: bash
- name: Compile Thrift
run: npm run compile
shell: bash

View File

@ -1,32 +1,31 @@
name: Build
name: Build & Push
on:
push:
branches: [master]
pull_request:
branches: ["*"]
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
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Init Thrift
uses: valitydev/action-setup-thrift@v0.0.1
- name: Init
uses: ./.github/actions/init
- name: Init NodeJS
uses: actions/setup-node@v2
with:
node-version: '16.4.2'
cache: 'npm'
- name: Check & Build
run: npm run ci:build
- name: Install Packages
run: npm ci
- name: Compile Thrift
run: npm run compile
- 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 }}

20
.github/workflows/pr-build-check.yaml vendored Normal file
View File

@ -0,0 +1,20 @@
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
- name: Init
uses: ./.github/actions/init
- name: Check & Build
run: npm run ci:build

View File

@ -1,13 +1,12 @@
name: 'PR Title Checker'
on:
pull_request:
types: [edited, opened, synchronize, reopened]
branches: [disabled]
pull_request:
types: [edited, opened, synchronize, reopened]
branches: [disabled]
jobs:
title-check:
runs-on: ubuntu-latest
steps:
- uses: naveenk1223/action-pr-title@master
with:
regex: '([A-Z]+-[0-9]+,?)+: [A-Z0-9].*'
title-check:
runs-on: ubuntu-latest
steps:
- uses: naveenk1223/action-pr-title@master
with:
regex: '([A-Z]+-[0-9]+,?)+: [A-Z0-9].*'

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM nginx:1.21
COPY dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/vhosts.d/control-center.conf

View File

@ -13,7 +13,7 @@
"lint": "eslint \"src/**/*.{ts,js,html}\" --max-warnings 2070 --cache",
"lint-errors": "npm run lint -- --quiet --format codeframe",
"lint-fix": "npm run lint -- --fix",
"prettier-preset": "prettier \"**/*.{html,js,ts,css,scss,md,json,prettierrc,svg,huskyrc}\"",
"prettier-preset": "prettier \"**/*.{html,js,ts,css,scss,md,json,prettierrc,svg,huskyrc,yml,yaml}\"",
"prettier": "npm run prettier-preset -- --list-different",
"prettier:fix": "npm run prettier-preset -- --write",
"fix": "npm run lint-fix; npm run prettier:fix",

View File

@ -1,18 +1,11 @@
{
"extends": [
"config:base"
],
"packageRules": [
{
"matchPackagePatterns": [
"*"
],
"matchUpdateTypes": [
"minor",
"patch"
],
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch"
}
]
"extends": ["config:base"],
"packageRules": [
{
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch"
}
]
}