-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
98 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,31 +7,27 @@ on: | |
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18] | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout Master | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/[email protected] | ||
with: | ||
version: 8 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: pnpm | ||
node-version: 18 | ||
cache: 'pnpm' | ||
|
||
- name: Install Dependencies | ||
run: pnpm i | ||
run: pnpm i --frozen-lockfile | ||
|
||
- name: Lint Format | ||
run: pnpm lint:prettier | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [main, dev] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/[email protected] | ||
with: | ||
version: 8 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
|
||
- name: Install Dependencies | ||
run: pnpm i --frozen-lockfile | ||
|
||
- name: Run Tests | ||
run: pnpm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
import { create } from '../dist/create-app.js'; | ||
|
||
const repo = process.argv[2] ?? './next-docs-ui-template'; | ||
|
||
fs.readdirSync(repo).forEach((file) => { | ||
if (file !== '.git') { | ||
fs.rmSync(path.join(repo, file), { | ||
recursive: true, | ||
force: true, | ||
}); | ||
} | ||
}); | ||
|
||
await create({ | ||
outputDir: repo, | ||
template: 'next-docs-mdx', | ||
tailwindcss: false, | ||
installDeps: false, | ||
packageManager: 'npm', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
# Inspired by Svelte Kit | ||
|
||
get_abs_filename() { | ||
# $1 : relative filename | ||
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" | ||
} | ||
|
||
DIR=$(get_abs_filename $(dirname "$0")) | ||
TMP=$(get_abs_filename "$DIR/../node_modules/.tmp") | ||
|
||
if [ "$CI" ]; then | ||
(umask 0077; echo "$UPDATE_TEMPLATE_SSH_KEY" > ~/ssh_key;) | ||
export GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=accept-new -i ~/ssh_key' | ||
fi | ||
|
||
mkdir -p $TMP | ||
cd $TMP | ||
|
||
# clone the template repo | ||
rm -rf next-docs-ui-template | ||
git clone --depth 1 --single-branch --branch main https://github.com/fuma-nama/next-docs-ui-template.git | ||
|
||
# empty out the repo | ||
cd next-docs-ui-template | ||
node $DIR/update-git-repo.js $TMP/next-docs-ui-template | ||
|
||
if [ "$CI" ]; then | ||
git config user.email '[email protected]' | ||
git config user.name '[bot]' | ||
fi | ||
|
||
# commit the new files | ||
git add -A | ||
git commit -m "version $npm_package_version" | ||
|
||
git push https://github.com/fuma-nama/next-docs-ui-template.git main -f |