Skip to content

Commit

Permalink
feat: some scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander committed Jul 9, 2024
1 parent d19c0fd commit 2973bbc
Show file tree
Hide file tree
Showing 17 changed files with 6,506 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Merge dependency updates

on:
workflow_run:
types:
- completed
workflows:
- 'Docker build'
- 'Lint files'

jobs:
merge-dependency-updates:
name: Merge dependency updates
runs-on: ubuntu-latest
steps:
- name: Merge dependency updates
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: ridedott/merge-me-action@v2
with:
# This must be used as GitHub Actions token does not support pushing
# to protected branches.
GITHUB_TOKEN: ${{ secrets.AUTO_MERGE_PR_TOKEN }}
PRESET: DEPENDABOT_MINOR
45 changes: 45 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Lint and test

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint-test:
name: Lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies, lint files and run tests
run: |
npm ci
npm run lint
npm run test
- name: Save code coverage to artifact
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: "coverage/clover.xml"
retention-days: 5
upload-coverage:
name: Upload code coverage
runs-on: ubuntu-latest
needs:
- lint-test
steps:
- name: Fetch code coverage artifact
uses: actions/download-artifact@v4
with:
name: code-coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
14 changes: 14 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Publish release

on:
push:
branches: [main]

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit "$1"
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.1"
}
13 changes: 13 additions & 0 deletions _site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en-CA">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello, world!</title>

</head>
<body>
<h1>Hello, world!</h1>

</body>
</html>
12 changes: 12 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
"extends": ["node_modules/biome-config-fluid/biome.jsonc"],
"files": {
"ignore": ["src/_data/*.json"]
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
5 changes: 5 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const commitlintConfig = {
extends: ["@commitlint/config-conventional"]
};

export default commitlintConfig;
25 changes: 25 additions & 0 deletions eleventy.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { EleventyRenderPlugin } from "@11ty/eleventy";

export default function eleventy(eleventyConfig) {
eleventyConfig.addPlugin(EleventyRenderPlugin);

eleventyConfig.addPassthroughCopy({
"src/admin/config.yml": "admin/config.yml"
});

eleventyConfig.addPassthroughCopy({
"src/assets": "assets"
});

return {
dir: {
input: "src",
includes: "_includes",
layouts: "_layouts",
data: "_data"
},
templateFormats: ["njk", "md", "css", "png", "jpg", "svg"],
htmlTemplateEngine: "njk",
markdownTemplateEngine: "njk"
};
}
Loading

0 comments on commit 2973bbc

Please sign in to comment.