Hourly Academy Expansion #38
This file contains hidden or 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: Hourly AI Training Tip | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' # Every hour on the dot | |
| workflow_dispatch: # Allows you to run it manually to test | |
| permissions: | |
| contents: write # Required to allow the bot to push .md files to your repo | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 # Use V4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' # Using a modern node version | |
| - name: Install dependencies | |
| run: | | |
| npm init -y | |
| npm install firebase-admin @google/generative-ai | |
| - name: Execute AI Script | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }} | |
| run: node scripts/generate-ai-tip.js | |
| - name: Commit & Push Documentation 📝 | |
| run: | | |
| git config --global user.name 'Academy-Writer-Bot' | |
| git config --global user.email 'bot@littleslaw.com' | |
| git add docs/ | |
| git commit -m "Auto-update wiki: [${{ github.workflow }}]" || echo "No changes to commit" | |
| git push |