Skip to content

Generate SCP Entry

Generate SCP Entry #21

name: Generate SCP Entry
on:
schedule:
- cron: "0 0 * * *" # Run daily at midnight UTC
workflow_dispatch: # Allow manual trigger
jobs:
generate-and-deploy:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r scp/requirements.txt
- name: Run SCP generator
run: python scp/scp-runner.py
env:
DOTTXT_API_KEY: ${{ secrets.DOTTXT_API_KEY }}
DOTTXT_API_HOST: ${{ secrets.DOTTXT_API_HOST }}
- name: Configure Git
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Create and switch to gh-pages branch
run: |
git checkout -b gh-pages
git pull origin gh-pages || true
- name: Copy generated files
run: |
mkdir -p scp/entries
cp -R entries/* scp/entries/
- name: Generate index
run: python scp/generate_index.py
- name: Commit and push changes
run: |
git add -f scp/entries
git commit -m "Add new SCP entry and update index" || echo "No changes to commit"
git push origin gh-pages