Reset Database and Cloudinary #2072
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
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 |