add workflow #3
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: databuilder | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
run-workflow-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v2 | |
with: | |
ref: main | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11.4" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run Python script | |
run: python src/workflow.py | |
- name: Check changes | |
run: | | |
git add . | |
git diff-index --quiet HEAD || echo "::set-output name=changed::true" | |
- name: Checkout production branch | |
uses: actions/checkout@v2 | |
with: | |
ref: production | |
- name: Configure Git | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Check changes | |
run: | | |
git add . | |
git diff-index --quiet HEAD || echo "::set-output name=changed::true" | |
- name: Commit and push changes | |
run: | | |
git add . | |
git commit -m "Add generated files" | |
git push origin production |