Skip to content
This repository was archived by the owner on May 17, 2023. It is now read-only.

Commit fd04dc8

Browse files
committed
feat: initial commit
0 parents  commit fd04dc8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+22324
-0
lines changed

.eslintrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": [
3+
"next/core-web-vitals",
4+
"prettier",
5+
"plugin:storybook/recommended"
6+
]
7+
}

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: "\U0001F41B Bug report"
3+
about: Create a report of bugs
4+
---
5+
6+
## Bug Report
7+
8+
**Which part of the project does this belongs to ?**
9+
10+
#### Issue Description
11+
12+
- When Issue Happens
13+
14+
- Steps To Reproduce
15+
16+
#### Browser Information
17+
18+
- Browser Name, Version
19+
- Operating System
20+
21+
#### Your Code (Optional)
22+
23+
```
24+
If relevant, paste all of your test code in here
25+
```
26+
27+
#### Screenshot

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: "\U0001F680 Feature"
3+
about: "Suggests features to be implemented"
4+
labels: "i: enhancement"
5+
---
6+
7+
## Feature Request
8+
9+
**Which part of the project does this belongs to ?**
10+
11+
**Description**

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Implements/Fixes(DELETE THE WRONG ONE) #
2+
3+
**If your PR is not WIP, Please check if your PR fulfills these requirements**
4+
5+
- [ ] The PR title follows the guidelines
6+
7+
**Which part of the project does this PR belongs to ?**
8+
9+
**What is the current behavior ?**
10+
11+
**Does this PR introduce a breaking change ?**
12+
13+
**Other information**

.github/workflows/build.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build
2+
3+
on:
4+
workflow_run:
5+
workflows: [Test]
6+
types:
7+
- completed
8+
branches: [main]
9+
10+
jobs:
11+
build:
12+
name: build and upload with cache
13+
runs-on: ubuntu-latest
14+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
15+
permissions:
16+
# only required for workflows in private repositories
17+
contents: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
with:
22+
ref: ${{ github.head_ref }}
23+
24+
- name: Install Node.js
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: latest
28+
29+
- uses: pnpm/action-setup@v2
30+
name: Install pnpm
31+
id: pnpm-install
32+
with:
33+
version: latest
34+
run_install: false
35+
36+
- name: Get pnpm store directory
37+
id: pnpm-cache
38+
shell: bash
39+
run: |
40+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
41+
42+
- uses: actions/cache@v3
43+
name: Setup pnpm cache
44+
with:
45+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
46+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
47+
restore-keys: |
48+
${{ runner.os }}-pnpm-store-
49+
50+
- name: Install dependencies
51+
run: pnpm install
52+
53+
- uses: actions/cache@v3
54+
name: setup next cache
55+
with:
56+
# See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
57+
path: |
58+
~/.npm
59+
${{ github.workspace }}/.next/cache
60+
# Generate a new cache whenever packages or source files change.
61+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
62+
# If source files changed but packages didn't, rebuild from a prior cache.
63+
restore-keys: |
64+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
65+
66+
- name: Build
67+
run: pnpm run build
68+
69+
- name: tarball
70+
run: tar cvzf build.tar.gz .next
71+
72+
- uses: actions/upload-artifact@v3
73+
with:
74+
name: build
75+
path: build.tar.gz

.github/workflows/commitlint.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Lint Commit Messages
2+
on: [push]
3+
4+
jobs:
5+
commitlint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
with:
10+
fetch-depth: 0
11+
- uses: wagoid/commitlint-github-action@v4

.github/workflows/deploy.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
build:
9+
name: build and deploy
10+
runs-on: ubuntu-latest
11+
permissions:
12+
# only required for workflows in private repositories
13+
contents: write
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- uses: pnpm/action-setup@v2
19+
name: Install pnpm
20+
id: pnpm-install
21+
with:
22+
version: latest
23+
run_install: false
24+
25+
- name: Get pnpm store directory
26+
id: pnpm-cache
27+
shell: bash
28+
run: |
29+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
30+
31+
- uses: actions/cache@v3
32+
name: Setup pnpm cache
33+
with:
34+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
35+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
36+
restore-keys: |
37+
${{ runner.os }}-pnpm-store-
38+
39+
- name: Install dependencies
40+
run: pnpm install
41+
42+
- name: Install Node.js
43+
uses: actions/setup-node@v3
44+
with:
45+
node-version: latest
46+
47+
- name: build
48+
run: pnpm run build
49+
50+
# - name: Deploy to AWS
51+
# uses: easingthemes/ssh-deploy@main
52+
# env:
53+
# SSH_PRIVATE_KEY: ${{ secrets.AWS_EC2_RSA_KEY }}
54+
# REMOTE_HOST: ${{ secrets.AWS_HOST }}
55+
# REMOTE_USER: ${{ secrets.AWS_USERNAME }}
56+
# SOURCE: "dist/"
57+
# TARGET: ~/my-project

.github/workflows/e2e.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: E2E
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_run:
6+
workflows: Test
7+
types:
8+
- completed
9+
jobs:
10+
test:
11+
name: Do playwright testing
12+
runs-on: ubuntu-latest
13+
permissions:
14+
# only required for workflows in private repositories
15+
contents: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
with:
20+
ref: ${{ github.head_ref }}
21+
22+
- name: Install Node.js
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: latest
26+
27+
- uses: pnpm/action-setup@v2
28+
name: Install pnpm
29+
id: pnpm-install
30+
with:
31+
version: latest
32+
run_install: false
33+
34+
- name: Get pnpm store directory
35+
id: pnpm-cache
36+
shell: bash
37+
run: |
38+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
39+
40+
- uses: actions/cache@v3
41+
name: Setup pnpm cache
42+
with:
43+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
44+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
45+
restore-keys: |
46+
${{ runner.os }}-pnpm-store-
47+
48+
- name: Install dependencies
49+
run: pnpm install
50+
51+
- name: Store Playwright's Version
52+
run: |
53+
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test | grep @playwright | sed 's/.*@//')
54+
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
55+
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
56+
57+
- name: Cache Playwright Browsers for Playwright's Version
58+
id: cache-playwright-browsers
59+
uses: actions/cache@v3
60+
with:
61+
path: ~/.cache/ms-playwright
62+
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
63+
64+
- name: Setup Playwright
65+
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
66+
run: pnpm exec playwright install --with-deps
67+
68+
- run: npx playwright install-deps
69+
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
70+
71+
- name: Cache pocketbase
72+
id: cache-pocketbase
73+
uses: actions/cache@v3
74+
with:
75+
path: pb
76+
key: ${{ runner.os }}-pocketbase
77+
78+
- name: Download PocketBase
79+
if: steps.cache-pocketbase.outputs.cache-hit != 'true'
80+
run: ./pb-setup.sh
81+
82+
- name: Run your tests
83+
run: pnpm run test:e2e
84+
85+
- name: Upload test results
86+
if: always()
87+
uses: actions/upload-artifact@v3
88+
with:
89+
name: playwright-report
90+
path: playwright-report
91+
92+
- name: Store Artifacts from Failed Tests
93+
if: failure()
94+
uses: actions/upload-artifact@v2
95+
with:
96+
name: test-results
97+
path: test-results/
98+
retention-days: 7

.github/workflows/lint.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- "**.md"
7+
- "**.yml"
8+
pull_request:
9+
paths-ignore:
10+
- "**.md"
11+
- "**.yml"
12+
13+
jobs:
14+
lint:
15+
name: lint and format
16+
runs-on: ubuntu-latest
17+
permissions:
18+
# only required for workflows in private repositories
19+
contents: write
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
with:
24+
ref: ${{ github.head_ref }}
25+
26+
- name: Install Node.js
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: latest
30+
31+
- uses: pnpm/action-setup@v2
32+
name: Install pnpm
33+
id: pnpm-install
34+
with:
35+
version: latest
36+
run_install: false
37+
38+
- name: Get pnpm store directory
39+
id: pnpm-cache
40+
shell: bash
41+
run: |
42+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
43+
44+
- uses: actions/cache@v3
45+
name: Setup pnpm cache
46+
with:
47+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
48+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
49+
restore-keys: |
50+
${{ runner.os }}-pnpm-store-
51+
52+
- name: Install dependencies
53+
run: pnpm install
54+
55+
- name: Run Linter and fix
56+
run: pnpm run lint:fix
57+
58+
- uses: stefanzweifel/git-auto-commit-action@v4
59+
with:
60+
commit_message: "style: :robot: autofix code by github action"

0 commit comments

Comments
 (0)