python #543
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: python | |
on: | |
schedule: | |
- cron: '0 6 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
outputs: | |
deploy: ${{ steps.commit.outputs.deploy }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run Python script | |
env: | |
CF_ACCOUNT: ${{ secrets.CF_ACCOUNT }} | |
CF_KEY: ${{ secrets.CF_KEY }} | |
run: python lnrelease/lnrelease.py | |
- name: Commit and push | |
id: commit | |
run: | | |
git add -u | |
echo "deploy=$(git diff --staged --quiet books.csv; echo $?)" >> $GITHUB_OUTPUT | |
if git diff --staged --quiet; then | |
echo "Finished, no changes" | |
else | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git commit -m "update" | |
git push | |
fi | |
deploy: | |
needs: update | |
if: needs.update.outputs.deploy == '1' | |
uses: ./.github/workflows/pages.yml |