Skip to content

Instantly share code, notes, and snippets.

@mat-0
Created June 5, 2022 08:32
Show Gist options
  • Select an option

  • Save mat-0/314fc390936e862bc4c264e1e1cc57d0 to your computer and use it in GitHub Desktop.

Select an option

Save mat-0/314fc390936e862bc4c264e1e1cc57d0 to your computer and use it in GitHub Desktop.
2020-09-05-php-to-python-with-GitHub-actions.md 3
name: Daily Build
# build
on:
workflow_dispatch:
schedule:
- cron: '30 7 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/cache@v2
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: |
python -m pip install -r requirements.txt
- name: Update README
run: |-
python 'python/build.py'
cat README.md
- name: Commit and push if README changed
run: |-
git diff
git config --global user.email "[email protected]"
git config --global user.name "README-bot"
git diff --quiet || (git add README.md && git commit -m "Updated README")
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment