Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoKle committed Jun 23, 2024
1 parent 3bd039a commit 67b8abc
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
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: Archive generated files as artifact
uses: actions/upload-artifact@v2
with:
name: generated-files
path: ./api

- name: Checkout production branch
uses: actions/checkout@v2
with:
ref: production

- name: Download generated files artifact
uses: actions/download-artifact@v2
with:
name: generated-files
path: ./api

- name: Apply changes to production branch
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add generated files from main branch"
git push origin production

0 comments on commit 67b8abc

Please sign in to comment.