-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 1019 Bytes
/
reset-data.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Reset Database and Cloudinary
on:
schedule:
- cron: '0 * * * *' # Every hour
workflow_dispatch:
jobs:
reset-db:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18.x'
- name: Navigate to API directory, install dependencies, and run reset script
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
ADMIN_ID: ${{ secrets.ADMIN_ID }}
ADMIN_EMAIL: ${{ secrets.ADMIN_EMAIL }}
ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }}
EXAMPLE_COURSE_ID: ${{ secrets.EXAMPLE_COURSE_ID }}
run: |
cd api
npm install
node scripts/resetData.js