Skip to content

Commit

Permalink
update github action
Browse files Browse the repository at this point in the history
  • Loading branch information
madjin committed Dec 15, 2023
1 parent 5a150e8 commit 642a26f
Showing 1 changed file with 26 additions and 48 deletions.
74 changes: 26 additions & 48 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,32 @@
name: Deploy to GitHub Pages

on:
# When someone push or merge a pull request
# inside the main branch
push:
# branches:
# - main
# When someone create a pull request from
# the main branch
pull_request:
branches:
- main
- main # or the branch you want to trigger the deployment on

jobs:
check-quality:
deploy:
runs-on: ubuntu-latest
name: Running Code Quality Analysis

steps:
- name: Configure GH Checkout
# Ready-to-use action made by GH or third party
# companies
# We can recognize the GH actions from the third party
# ones checking the name prefix.
# `actions/` = GH
# `something-else/` = third party
# This is a GH ready-to-use action
uses: actions/checkout@v2

- name: Install Node Modules
# Run the lint custom NPM command that triggers the
# ESLint linter check
run: npm install --force

- name: Run ESLint
# Run the lint custom NPM command that triggers the
# ESLint linter check
run: npm run lint:js

- name: Repo Visualizer
uses: githubocto/[email protected]

- name: Check code meets quality standards
id: code-inspector
uses: codeinspectorio/github-action@master
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
code_inspector_api_token: ${{ secrets.CODE_INSPECTOR_API_TOKEN }}
force_ref: 'none'
min_quality_grade: 'WARNING'
min_quality_score: '50'
max_defects_rate: '0.0001'
max_complex_functions_rate: '0.0001'
max_long_functions_rate: '0.0001'
project_name: ''
max_timeout_sec: '600'
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # or the version you need

- name: Install dependencies
run: npm install --legacy-deps

- name: Build
run: npm run build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist

0 comments on commit 642a26f

Please sign in to comment.