Skip to content

PyHC Environment Pipeline Workflow #367

PyHC Environment Pipeline Workflow

PyHC Environment Pipeline Workflow #367

name: PyHC Environment Pipeline Workflow
on:
schedule:
- cron: '0 7 * * *' # Runs at midnight Mountain Time (UTC-7)
workflow_dispatch:
jobs:
run-pipeline:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Fetch LFS Files
run: git lfs pull
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Pipeline Dependencies
run: |
pip install -r pipeline_requirements.txt
- name: Run Pipeline Script
id: pipeline_check
run: python pipeline.py
- name: Update README Table
if: steps.pipeline_check.outputs.should_run == 'true'
run: python utils/update_readme.py
- name: Build and Push Docker Images
if: steps.pipeline_check.outputs.should_run == 'true'
run: python utils/docker_operations.py ./docker ${{ secrets.DOCKER_HUB_USERNAME }} ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Commit and Push Repo Changes
if: steps.pipeline_check.outputs.should_run == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Update Docker image requirements, spreadsheet, README" || exit 0
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify on Successful Push
if: steps.pipeline_check.outputs.should_run == 'true'
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: 2
body: |
Docker Hub images and GitHub repo have been updated by GitHub Actions.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}