Skip to content

Commit a3caf43

Browse files
authored
Initial commit
0 parents  commit a3caf43

32 files changed

+15375
-0
lines changed

.bluprintrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"bluprint": "^0.6.6",
3+
"name": "baker-example-page",
4+
"category": "baker",
5+
"actions": [
6+
{
7+
"action": "execute",
8+
"cmds": [
9+
["npm", ["install"]]
10+
]
11+
},
12+
{
13+
"action": "log",
14+
"msg": "\n\n🏁 Finished creating your project.\n\nRun {green npm start} to open a test page.\n"
15+
}
16+
]
17+
}

.devcontainer/devcontainer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "Node.js",
3+
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-16",
4+
"forwardPorts": [3000],
5+
"postCreateCommand": "npm install"
6+
}

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.py]
12+
indent_size = 4
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.github/images/draft-release.png

71.6 KB
Loading

.github/images/publish-release.png

117 KB
Loading

.github/images/releases.png

162 KB
Loading
13.7 KB
Loading

.github/images/version-release.png

118 KB
Loading

.github/workflows/deploy-prod.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Deploy to production
2+
3+
concurrency:
4+
group: deploy-prod-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
workflow_dispatch:
9+
release:
10+
types: [published,]
11+
12+
jobs:
13+
deploy:
14+
name: Deploy
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout the repo
18+
uses: actions/checkout@v3
19+
20+
- name: Use Node.js 14.x
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: 16
24+
cache: 'npm'
25+
26+
- id: install-project-modules
27+
name: Install project dependencies
28+
run: npm ci --production
29+
30+
- id: install-action-modules
31+
name: Install action dependencies
32+
run: npm install archieml
33+
34+
- id: get-slug
35+
name: Get slug
36+
uses: actions/github-script@v6
37+
with:
38+
result-encoding: string
39+
script: |
40+
// import modules
41+
const fs = require('fs');
42+
const archieml = require('archieml');
43+
44+
// Read in the slug file
45+
const meta = archieml.load(fs.readFileSync('_data/meta.aml', 'utf8'));
46+
47+
// Pull the slug
48+
const slug = meta.slug.trim();
49+
console.log(`slug -> ${slug}`);
50+
51+
// If we get this far, we're good to go.
52+
return meta.slug;
53+
54+
- id: slack
55+
name: Create Slack notification
56+
uses: datadesk/notify-slack-on-build@v3
57+
with:
58+
slack-token: ${{ secrets.BAKER_BOT_SLACK_TOKEN }}
59+
channel-name: ${{ secrets.BAKER_BOT_SLACK_CHANNEL_NAME }}
60+
status: in_progress
61+
url: http://baker-example-page-template-production.s3-website-us-east-1.amazonaws.com/${{ steps.get-slug.outputs.result }}/
62+
63+
- id: npm-build
64+
name: Build project distribution
65+
run: npm run build
66+
env:
67+
BAKER_PATH_PREFIX: ${{ steps.get-slug.outputs.result }}
68+
69+
- id: configure-aws
70+
name: Configure AWS Credentials
71+
uses: aws-actions/configure-aws-credentials@v1
72+
with:
73+
aws-access-key-id: ${{ secrets.BAKER_AWS_ACCESS_KEY_ID }}
74+
aws-secret-access-key: ${{ secrets.BAKER_AWS_SECRET_ACCESS_KEY }}
75+
aws-region: ${{ secrets.BAKER_AWS_S3_PRODUCTION_REGION }}
76+
77+
- id: npm-deploy
78+
name: Upload the prepared files
79+
uses: datadesk/delivery-deploy-action@v1
80+
with:
81+
bucket: ${{ secrets.BAKER_AWS_S3_PRODUCTION_BUCKET }}
82+
base-path: ${{ steps.get-slug.outputs.result }}
83+
dir: _dist
84+
should-cache: true
85+
use-accelerate-endpoint: false
86+
public: true
87+
88+
- name: Update Slack notification (success)
89+
if: success()
90+
uses: datadesk/notify-slack-on-build@v3
91+
with:
92+
slack-token: ${{ secrets.BAKER_BOT_SLACK_TOKEN }}
93+
channel-id: ${{ steps.slack.outputs.channel-id }}
94+
status: success
95+
url: http://baker-example-page-template-production.s3-website-us-east-1.amazonaws.com/${{ steps.get-slug.outputs.result }}/
96+
message-id: ${{ steps.slack.outputs.message-id }}
97+
98+
- name: Update Slack notification (failure)
99+
if: failure()
100+
uses: datadesk/notify-slack-on-build@v3
101+
with:
102+
slack-token: ${{ secrets.BAKER_BOT_SLACK_TOKEN }}
103+
channel-id: ${{ steps.slack.outputs.channel-id }}
104+
status: failure
105+
url: http://baker-example-page-template-production.s3-website-us-east-1.amazonaws.com/${{ steps.get-slug.outputs.result }}/
106+
message-id: ${{ steps.slack.outputs.message-id }}

.github/workflows/deploy-stage.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Deploy to staging
2+
3+
concurrency:
4+
group: deploy-stage-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
workflow_dispatch:
9+
push:
10+
branches:
11+
- "**" # always deploy for branches
12+
tags-ignore:
13+
- "**" # never deploy for tags
14+
15+
jobs:
16+
deploy:
17+
name: Deploy
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout the repo
21+
uses: actions/checkout@v3
22+
23+
- name: Use Node.js 14.x
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 16
27+
cache: 'npm'
28+
29+
- name: npm install
30+
run: npm ci --production
31+
32+
- id: delivery-path-prefix
33+
name: Prepare the Delivery path prefix
34+
uses: actions/github-script@v6
35+
with:
36+
result-encoding: string
37+
script: |
38+
// import path module
39+
const path = require('path');
40+
41+
// get reference to this commit
42+
const ref = context.ref;
43+
44+
// get repo that triggered this push
45+
const { repo } = context.repo;
46+
47+
// pull branch name off the ref
48+
const parts = ref.split('/');
49+
const branch = parts[parts.length - 1];
50+
51+
// build path used for this deploy
52+
const basePath = path.join(repo, branch);
53+
54+
// return the prepared path as the output
55+
return basePath;
56+
57+
- name: Build the project
58+
run: npm run build
59+
env:
60+
BAKER_PATH_PREFIX: ${{ steps.delivery-path-prefix.outputs.result }}
61+
62+
# - name: Configure AWS Credentials
63+
# uses: aws-actions/configure-aws-credentials@v1
64+
# with:
65+
# aws-access-key-id: ${{ secrets.BAKER_AWS_ACCESS_KEY_ID }}
66+
# aws-secret-access-key: ${{ secrets.BAKER_AWS_SECRET_ACCESS_KEY }}
67+
# aws-region: ${{ secrets.BAKER_AWS_S3_STAGING_REGION }}
68+
69+
# - name: Upload the prepared files
70+
# uses: datadesk/delivery-deploy-action@v1
71+
# with:
72+
# bucket: ${{ secrets.BAKER_AWS_S3_STAGING_BUCKET }}
73+
# base-path: ${{ steps.delivery-path-prefix.outputs.result }}
74+
# dir: _dist
75+
# should-cache: true
76+
# use-accelerate-endpoint: false
77+
# public: true

0 commit comments

Comments
 (0)