Generate SCP Entry #6
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: Generate SCP Entry | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Run daily at midnight UTC | |
workflow_dispatch: # Allow manual trigger | |
jobs: | |
generate-and-deploy: | |
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.x' | |
- 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: Commit and push changes | |
run: | | |
git add scp/entries | |
git commit -m "Add new SCP entry" || echo "No changes to commit" | |
git push origin gh-pages |