Python application #1047
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 application | |
on: | |
workflow_dispatch: | |
schedule: | |
# Run every day at 8AM | |
- cron: '0 8 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
pip install simplejson requests | |
- name: Run app! | |
run: python script.py -k ${{ secrets.PLAUSIBLE_LIVE_KEY }} | |
- name: Check files | |
run: | | |
ls -a -R | |
- name: Git config | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "<>" | |
- name: Git status | |
run: git status | |
- name: Commit and push | |
run: | | |
YESTERDAY="$(date --date="yesterday" --rfc-3339=date)" | |
git add -A && git commit -m "Updated $YESTERDAY output" && git push origin main |