Skip to content

Commit

Permalink
Merge branch 'master' into mcliff1-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mcliff1 committed Nov 9, 2024
2 parents 495eb95 + 161c4b7 commit 3e7ad90
Show file tree
Hide file tree
Showing 24 changed files with 15,215 additions and 19,816 deletions.
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Cliff Consulting Dev Container",
"image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:0-14",
"runArgs": ["--privileged"],
"postCreateCommand": "npm install",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
},
"forwardPorts": [3000],
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached"
],
"workspaceFolder": "/workspace"
}
142 changes: 71 additions & 71 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
# 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: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '23 12 * * 4'

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' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

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

# 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.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, 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.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
# 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: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '23 12 * * 4'

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' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

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

# 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.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, 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.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
158 changes: 79 additions & 79 deletions .github/workflows/s3-publish.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
# this workflow will publish to an AWS S3 Bucket
#
# based off branch we will look up and gain credentials from the environment
# DEPLOY_{env}_KEY, SECRET, ROLE
#
# ref: https://github.com/mcliff1/cliffconsulting/new/master?filename=.github%2Fworkflows%2Faws.yml&workflow_template=aws
name: AWS Publish
#
# on:
# pull_request:
# branches:
# - master
# - release/dev
# push:
# - feature/*
on: [push]

jobs:

build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test

deploy:
name: Deploy
runs-on: ubuntu-latest

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

# https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions
- name: Configuration for Test
uses: aws-actions/configure-aws-credentials@v2
if: ${{ github.ref == 'refs/heads/release/dev' }}
with:
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
role-to-assume: ${{ secrets.TEST_AWS_ROLE_ARN }}
role-duration-seconds: 1800

- name: Configuration for Production
uses: aws-actions/configure-aws-credentials@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
role-to-assume: ${{ secrets.PROD_AWS_ROLE_ARN }}
role-duration-seconds: 1800


- name: Build And Deploy
run: |
ACCOUNT_NAME=$(aws ssm get-parameter --name /foundation/account/name --query 'Parameter.Value' --output text)
echo $ACCOUNT_NAME
BUCKET=$(aws ssm get-parameter --name /app/cdn/${ACCOUNT_NAME}-cliffconsulting/bucket --query 'Parameter.Value' --output text)
echo $BUCKET
npm install
npm run build
aws s3 sync ./build s3://${BUCKET}/ --delete
if: ${{ github.ref == 'refs/heads/release/dev' || github.ref == 'refs/heads/master' }}
# this workflow will publish to an AWS S3 Bucket
#
# based off branch we will look up and gain credentials from the environment
# DEPLOY_{env}_KEY, SECRET, ROLE
#
# ref: https://github.com/mcliff1/cliffconsulting/new/master?filename=.github%2Fworkflows%2Faws.yml&workflow_template=aws
name: AWS Publish
#
# on:
# pull_request:
# branches:
# - master
# - release/dev
# push:
# - feature/*
on: [push]

jobs:

build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test

deploy:
name: Deploy
runs-on: ubuntu-latest

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

# https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions
- name: Configuration for Test
uses: aws-actions/configure-aws-credentials@v2
if: ${{ github.ref == 'refs/heads/release/dev' }}
with:
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
role-to-assume: ${{ secrets.TEST_AWS_ROLE_ARN }}
role-duration-seconds: 1800

- name: Configuration for Production
uses: aws-actions/configure-aws-credentials@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
role-to-assume: ${{ secrets.PROD_AWS_ROLE_ARN }}
role-duration-seconds: 1800


- name: Build And Deploy
run: |
ACCOUNT_NAME=$(aws ssm get-parameter --name /foundation/account/name --query 'Parameter.Value' --output text)
echo $ACCOUNT_NAME
BUCKET=$(aws ssm get-parameter --name /app/cdn/${ACCOUNT_NAME}-cliffconsulting/bucket --query 'Parameter.Value' --output text)
echo $BUCKET
npm install
npm run build
aws s3 sync ./build s3://${BUCKET}/ --delete
if: ${{ github.ref == 'refs/heads/release/dev' || github.ref == 'refs/heads/master' }}
46 changes: 23 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules
.npm
.bash_history

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules
.npm
.bash_history

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Loading

0 comments on commit 3e7ad90

Please sign in to comment.