Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hrecht committed Mar 19, 2024
0 parents commit 5aa1ad4
Show file tree
Hide file tree
Showing 1,094 changed files with 75,395 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .bluprintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"bluprint": "^0.6.6",
"name": "baker-example-page",
"category": "baker",
"actions": [
{
"action": "execute",
"cmds": [
["npm", ["install"]]
]
},
{
"action": "log",
"msg": "\n\n🏁 Finished creating your project.\n\nRun {green npm start} to open a test page.\n"
}
]
}
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Node.js",
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-16",
"forwardPorts": [3000],
"postCreateCommand": "npm install"
}
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.py]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
Binary file added .github/images/draft-release.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/publish-release.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/releases.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/use-this-template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/version-release.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Deploy to production

concurrency:
group: deploy-prod-${{ github.ref }}
cancel-in-progress: true

on:
workflow_dispatch:
release:
types: [published,]

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'

- id: install-project-modules
name: Install project dependencies
run: npm ci --production

- id: install-action-modules
name: Install action dependencies
run: npm install archieml

- id: get-slug
name: Get slug
uses: actions/github-script@v6
with:
result-encoding: string
script: |
// import modules
const fs = require('fs');
const archieml = require('archieml');
// Read in the slug file
const meta = archieml.load(fs.readFileSync('_data/meta.aml', 'utf8'));
// Pull the slug
const slug = meta.slug.trim();
console.log(`slug -> ${slug}`);
// If we get this far, we're good to go.
return meta.slug;
- id: slack
name: Create Slack notification
uses: datadesk/notify-slack-on-build@v3
with:
slack-token: ${{ secrets.BAKER_BOT_SLACK_TOKEN }}
channel-name: ${{ secrets.BAKER_BOT_SLACK_CHANNEL_NAME }}
status: in_progress
url: http://baker-example-page-template-production.s3-website-us-east-1.amazonaws.com/${{ steps.get-slug.outputs.result }}/

- id: npm-build
name: Build project distribution
run: npm run build
env:
BAKER_PATH_PREFIX: ${{ steps.get-slug.outputs.result }}

- id: configure-aws
name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.BAKER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.BAKER_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.BAKER_AWS_S3_PRODUCTION_REGION }}

- id: npm-deploy
name: Upload the prepared files
uses: datadesk/delivery-deploy-action@v1
with:
bucket: ${{ secrets.BAKER_AWS_S3_PRODUCTION_BUCKET }}
base-path: ${{ steps.get-slug.outputs.result }}
dir: _dist
should-cache: true
use-accelerate-endpoint: false
public: true

- name: Update Slack notification (success)
if: success()
uses: datadesk/notify-slack-on-build@v3
with:
slack-token: ${{ secrets.BAKER_BOT_SLACK_TOKEN }}
channel-id: ${{ steps.slack.outputs.channel-id }}
status: success
url: http://baker-example-page-template-production.s3-website-us-east-1.amazonaws.com/${{ steps.get-slug.outputs.result }}/
message-id: ${{ steps.slack.outputs.message-id }}

- name: Update Slack notification (failure)
if: failure()
uses: datadesk/notify-slack-on-build@v3
with:
slack-token: ${{ secrets.BAKER_BOT_SLACK_TOKEN }}
channel-id: ${{ steps.slack.outputs.channel-id }}
status: failure
url: http://baker-example-page-template-production.s3-website-us-east-1.amazonaws.com/${{ steps.get-slug.outputs.result }}/
message-id: ${{ steps.slack.outputs.message-id }}
77 changes: 77 additions & 0 deletions .github/workflows/deploy-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Deploy to staging

concurrency:
group: deploy-stage-${{ github.ref }}
cancel-in-progress: true

on:
workflow_dispatch:
push:
branches:
- "**" # always deploy for branches
tags-ignore:
- "**" # never deploy for tags

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'

- name: npm install
run: npm ci --production

- id: delivery-path-prefix
name: Prepare the Delivery path prefix
uses: actions/github-script@v6
with:
result-encoding: string
script: |
// import path module
const path = require('path');
// get reference to this commit
const ref = context.ref;
// get repo that triggered this push
const { repo } = context.repo;
// pull branch name off the ref
const parts = ref.split('/');
const branch = parts[parts.length - 1];
// build path used for this deploy
const basePath = path.join(repo, branch);
// return the prepared path as the output
return basePath;
- name: Build the project
run: npm run build
env:
BAKER_PATH_PREFIX: ${{ steps.delivery-path-prefix.outputs.result }}

# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.BAKER_AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.BAKER_AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ secrets.BAKER_AWS_S3_STAGING_REGION }}

# - name: Upload the prepared files
# uses: datadesk/delivery-deploy-action@v1
# with:
# bucket: ${{ secrets.BAKER_AWS_S3_STAGING_BUCKET }}
# base-path: ${{ steps.delivery-path-prefix.outputs.result }}
# dir: _dist
# should-cache: true
# use-accelerate-endpoint: false
# public: true
123 changes: 123 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# build directory
_dist

# Jupyter notebooks checkpoints
.ipynb_checkpoints
*/.ipynb_checkpoints/*

# .DS_Stores
*.DS_Store
.DS_Store

# Text editors
.vscode

# VIM
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim
Sessionx.vim

# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package.json
package-lock.json
*.html
*.njk
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Cherry Blossoms

Data visualization and musings on cherry blossom peak bloom. See the [methodology](https://www.hrecht.com/cherry-blossoms/#about) for details on tools and data sources.
Loading

0 comments on commit 5aa1ad4

Please sign in to comment.