Skip to content

Commit

Permalink
Merge pull request #319 from premieroctet/workflow/add-reset-database
Browse files Browse the repository at this point in the history
Add reset cron on workflow
  • Loading branch information
cregourd authored May 29, 2024
2 parents 748cc64 + 8d21d16 commit a91f8b9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/reset-database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
schedule:
- cron: "0 0 * * *"

jobs:
reset-db:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: yarn install
- name: Reset database
run: yarn reset-database
1 change: 1 addition & 0 deletions apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"start": "next start",
"lint": "next lint",
"database": "prisma migrate dev && prisma db seed",
"reset-database": "prisma migrate reset --force && prisma migrate dev && prisma db seed",
"postinstall": "prisma generate",
"prisma:migrate:dev": "prisma migrate dev",
"vercel-build": "prisma generate && prisma migrate deploy && next build",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"test": "turbo run test",
"test:e2e": "dotenv turbo test:e2e",
"database": "dotenv turbo run database",
"reset-database": "dotenv turbo run reset-database",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"publish-package": "yarn build:next-admin && changeset publish",
"changeset-version": "(changeset version) && cp packages/next-admin/CHANGELOG.md apps/docs/pages/changelog/index.md"
Expand Down
5 changes: 4 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"test": {},
"test:coverage": {},
"test:e2e": {},
"database": {}
"database": {},
"reset-database": {
"cache": false
}
}
}

0 comments on commit a91f8b9

Please sign in to comment.