Generate Templates Data #74
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: Generate Templates Data | |
| on: | |
| push: | |
| paths: | |
| - 'cves/**/index.yaml' | |
| - 'benchmarks/**/index.yaml' | |
| - 'labs/**/index.yaml' | |
| - 'http/**/index.yaml' | |
| - '.assets/**' | |
| - 'README.md' | |
| - '.github/workflows/generate-data.yml' | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| generate: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| actions: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: pip install pyyaml | |
| - name: Generate templates.json | |
| run: python .assets/generate_templates.py | |
| - name: Update README | |
| run: python .assets/update_readme.py | |
| - name: Generate stats.json | |
| run: python .assets/generate_stats.py | |
| - name: Commit changes | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add .assets/templates.json .assets/stats.json README.md | |
| git diff --staged --quiet || git commit -m "chore: update templates.json and README" | |
| git push | |
| - name: Trigger vt-site deployment | |
| if: success() | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ secrets.G_TOKEN }} | |
| repository: HappyHackingSpace/vt-site | |
| event-type: templates-updated |