Skip to content

Commit

Permalink
chore(ci): add ci pipeline to automate builds
Browse files Browse the repository at this point in the history
  • Loading branch information
MrYuion committed Aug 16, 2022
1 parent 36f4742 commit 354df1b
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Code scanning - action"

on:
push:
pull_request:
schedule:
- cron: '0 10 * * 4'

jobs:
CodeQL-Build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v1

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
87 changes: 87 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# This is a basic workflow to help you get started with Actions

name: Release

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/[email protected]

- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: ts-client-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install node modules
run: npm install

- name: Test Library
run: npm run test

- name: Build Library
run: npm run build

- name: Generate Documentation
run: npm run docs

- name: Update application version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run semantic-release

- name: Publish generated content to GitHub Pages
uses: peaceiris/[email protected]
env:
PERSONAL_TOKEN: ${{ secrets.GH_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./docs
with:
emptyCommits: false

- name: G-Chat Success Notify
uses: Co-qn/google-chat-notification@releases/v1
with:
name: Build
url: ${{ secrets.CHAT_SUCCESS }}
status: ${{ job.status }}
if: success()

- name: G-Chat Failed Notify
uses: Co-qn/google-chat-notification@releases/v1
with:
name: Build
url: ${{ secrets.CHAT_ERROR }}
status: ${{ job.status }}
if: failure()

- name: G-Chat Cancelled Notify
uses: Co-qn/google-chat-notification@releases/v1
with:
name: Build
url: ${{ secrets.CHAT_ERROR }}
status: ${{ job.status }}
if: cancelled()

0 comments on commit 354df1b

Please sign in to comment.