generate_digits #444
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
# This is a basic workflow to help you get started with Actions | |
name: generate_digits | |
# Controls when the workflow will run | |
on: | |
# Run at midnight UTC | |
schedule: | |
- cron: '0 0 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
gen_digits: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Generate Digits | |
uses: nick-fields/retry@v2 | |
with: | |
timeout_seconds: 180 | |
max_attempts: 5 | |
command: | | |
export PYTHONPATH=$PYTHONPATH:`pwd` | |
python gen_digits.py | |
# Add new files in data folder, commit along with other modified files, push | |
- name: Commit files | |
run: | | |
git config --local user.name github-actions | |
git config --local user.email "actions@github.com" | |
git add data/* | |
git diff-index --quiet HEAD || git commit -am "GH ACTION $GITHUB_WORKFLOW $(date)" | |
git push origin $GITHUB_REF_NAME | |
env: | |
REPO_KEY: ${{secrets.GITHUB_TOKEN}} | |
username: github-actions |