feat: add db support #10
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
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
lint: | |
name: Lint and test project | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source project | |
uses: actions/[email protected] | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- run: bun install | |
- run: bun lint | |
- run: bun test | |
template_update: | |
needs: lint | |
name: Update template repository | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source project | |
uses: actions/[email protected] | |
with: | |
path: ./source | |
- name: Checkout template project | |
uses: actions/[email protected] | |
with: | |
repository: SparkBotDev/SparkBot | |
token: ${{ secrets.ACTIONS_TOKEN }} | |
path: ./template | |
- name: Copy files to template | |
run: | | |
rm -rf ./template/components | |
rm -rf ./template/lib | |
rm -rf ./template/loaders | |
rm -rf ./template/types | |
cp -rf ./source/components ./template/components | |
cp -rf ./source/lib ./template/lib | |
cp -rf ./source/loaders ./template/loaders | |
cp -rf ./source/types ./template/types | |
cp -f ./source/index.ts ./template/index.ts | |
cp -f ./source/sparkbot.config.ts ./template/sparkbot.config.ts | |
cp -f ./source/package.json ./template/package.json | |
cp -f ./source/README.md ./template/README.md | |
cp -f ./source/LICENSE ./template/LICENSE | |
cp -f ./source/tsconfig.json ./template/tsconfig.json | |
- name: Prepare package.json | |
uses: jaywcjlove/github-action-package@main | |
with: | |
path: ./template/package.json | |
unset: scripts,lint-staged,devDependencies | |
- name: Add types to package.json | |
uses: jaywcjlove/github-action-package@main | |
with: | |
path: ./template/package.json | |
data: | | |
{ | |
"devDependencies": { | |
"@types/bun": "latest" | |
} | |
} | |
- name: Push template | |
run: | | |
cd ./template | |
git add . | |
git config user.name github-actions | |
git config user.email [email protected] | |
git commit -am "${{ github.event.head_commit.message }}" | |
git push |