Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jburns24 committed Sep 5, 2023
0 parents commit f0004b5
Show file tree
Hide file tree
Showing 124 changed files with 53,373 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/docker-existing-dockerfile
{
"name": "Node 16",
"context": "../",
"dockerFile": "../Dockerfile",
"build": {
"target": "dev"
},
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"editorconfig.editorconfig",
"eamodio.gitlens",
"ms-vsliveshare.vsliveshare",
"naumovs.color-highlight",
"coenraads.bracket-pair-colorizer"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh"
},
"forwardPorts": [3000]
}
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# For more information visit https://editorconfig.org/

root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# 2 space indentation
[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_API_MOCKING=enabled
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_API_MOCKING=disabled
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
// See https://nextjs.org/docs/basic-features/eslint
extends: "next/core-web-vitals",
};
32 changes: 32 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
labels:
- "dependencies"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
labels:
- "dependencies"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
labels:
- "dependencies"


61 changes: 61 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build Container Image

on:
pull_request:
branches: [ main ]

workflow_call:
inputs:
tagTypes:
required: false
type: string
default: |
type=sha
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
name: Build and Publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}
# when opened on pull request, no inputs are provided. when empty the
# defaults are used which produces pr-* as the tag to the image using
# the below information.
# type=schedule,pattern=nightly,enable=true,priority=1000
# type=ref,event=branch,enable=true,priority=600
# type=ref,event=tag,enable=true,priority=600
# type=ref,event=pr,prefix=pr-,enable=true,priority=600
tags: |
${{ inputs.tagTypes }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker images
uses: docker/[email protected]
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
41 changes: 41 additions & 0 deletions .github/workflows/build-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow builds a nodejs app. It will run on pull requests and
# when called from another workflow.

name: Build Node Project
on:
pull_request:
branches: [ main ]
workflow_call:

jobs:
build-node:
name: Build Node project
runs-on: ubuntu-latest
outputs:
project-version: ${{ steps.project-version.outputs.version }}
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"

- name: Install Dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Unit Test
run: npm test

- name: Upload Coverage Report
uses: actions/upload-artifact@v3
with:
name: code-coverage
path: coverage/lcov.info

- name: Get NPM project version
id: project-version
run: echo "::set-output name=version::$(npm pkg get version | sed 's/\"//g')"
74 changes: 74 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
# schedule:
# - cron: '22 8 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
19 changes: 19 additions & 0 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This workflow checks that commits on the PR have been made against the
# conventional commits spec.

name: Conventional Commits

on:
pull_request:
types:
- opened
- edited
- synchronize

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: liatrio/github-actions/conventional-pr-title@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
57 changes: 57 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This workflow is the main workflow on pushing to the main branch
# and runs builds, releases, conventional commits, and pushes.

name: Main

on:
push:
branches: [ main ]

jobs:

build-node:
uses: ./.github/workflows/build-node.yml

build-image:
uses: ./.github/workflows/build-image.yml
needs: build-node
with:
tagTypes: |
type=sha
snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

release:
runs-on: ubuntu-latest
needs: [build-image, snyk]
outputs:
changed: ${{ steps.tag.outputs.changed }}
newVersion: ${{ steps.tag.outputs.newVersion }}
steps:
- name: Checkout code with commit history
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: liatrio/[email protected]
id: tag
with:
debug: true
env:
GITHUB_TOKEN: ${{ secrets.LIATRIO_BOT_PRIVATE_REPO_ACCESS_PAT }}

publish-image:
uses: ./.github/workflows/build-image.yml
needs: release
if: needs.release.outputs.changed == 'true'
with:
tagTypes: |
type=semver,pattern={{version}},value=${{ needs.release.outputs.newVersion }}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
Loading

0 comments on commit f0004b5

Please sign in to comment.