Update Workshop Page #124
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: Update Workshop Page | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' # Every day at 06:00 UTC | |
| workflow_dispatch: # Optional: allows manual runs from the Actions tab | |
| jobs: | |
| update-html: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main branch | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false # We'll use a deploy token | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Generate all_test.html | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npm run generate | |
| - name: Commit and push if changed | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }} | |
| git add all_test.html featured_workshops.html | |
| git diff --cached --quiet || git commit -m "Update workshop lists [auto]" | |
| git push origin HEAD:master | |