Skip to content

Commit

Permalink
chore: add ci/cd pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Quiddlee committed Dec 9, 2023
1 parent e5d8caf commit 6d1a6dc
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/actions/ci-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Setup Continuous Integration"
description: "Cache Dependencies"
runs:
using: "composite"
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"

- name: Cache NPM Dependencies
uses: actions/cache@v3
id: cache-primes
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
run: npm install
shell: bash
36 changes: 36 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## What type of PR is this? (select all that apply)

- [ ] 🍕 Feature
- [ ] 🐛 Bug Fix
- [ ] 🚧 Breaking Change
- [ ] 🧑‍💻 Code Refactor
- [ ] 📝 Documentation Update

## Description

## Related Tickets & Documents
<!--
For pull requests that relate or close an issue, please include them
below. We like to follow [Github's guidance on linking issues to pull requests](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
For example having the text: "closes #1234" would connect the current pull
request to issue 1234. And when we merge the pull request, Github will
automatically close the issue.
-->

- Related Issue #
- Closes #

## Screenshots, Recordings

_Please replace this line with any relevant images for UI changes._

## Added/updated tests?

- [ ] 👌 Yes
- [ ] 🙅‍♂️ No, because they aren't needed
- [ ] 🙋‍♂️ No, because I need help

## [optional] Are there any post deployment tasks we need to perform?

## [optional] What gif best describes this PR or how it makes you feel?
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Pull Request

on:
pull_request:
types:
- closed

permissions:
contents: write

env:
NODE_VERSION: 18.16.0

jobs:
if_merged:
if: github.event.pull_request.merged == true
name: Build And Deploy
runs-on: ubuntu-latest

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

- name: Setup Continuous integration
uses: ./.github/actions/ci-setup

- name: Build
run: npm run build

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Pull Request

on:
pull_request:
types: [opened, synchronize]

env:
NODE_VERSION: 18.16.0

jobs:
linting:
name: Lint
runs-on: ubuntu-latest

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

- name: Setup Continuous integration
uses: ./.github/actions/ci-setup

- name: Lint Application
run: npm run lint

type-check:
name: Types
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Continuous Integration
uses: ./.github/actions/ci-setup

- name: Check Application Types
run: npm run type-check

tests:
name: Test
runs-on: ubuntu-latest

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

- name: Setup Continuous integration
uses: ./.github/actions/ci-setup

- name: test
run: npm run test

0 comments on commit 6d1a6dc

Please sign in to comment.