Skip to content

Commit 2adb230

Browse files
committed
perf: create PR for app requirements
1 parent 72063ac commit 2adb230

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

.github/workflows/pi_build.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,45 @@ jobs:
5252
matrix:
5353
include: ${{ fromJson(needs.pi-diff.outputs.include) }}
5454
steps:
55-
- name: Print matrix values - ${{ matrix.parent_image_type }}
56-
run: echo "${{ toJson(matrix) }}"
55+
- name: Checkout Repository
56+
uses: actions/checkout@v4
57+
with:
58+
repository: '${{ github.repository_owner }}/refinery-${{ matrix.parent_image_type }}-parent-image'
59+
submodules: 'true'
60+
61+
- name: Set up Python
62+
uses: actions/setup-python@v5
63+
with:
64+
python-version: ${{ env.PYTHON_VERSION }}
65+
66+
- name: Install Dependencies
67+
run: python -m pip install pip-tools
68+
69+
- name: Compile Requirements
70+
run: pip-compile requirements/${{ matrix.parent_image_type }}-requirements.in
71+
72+
- name: Create PR - ${{ matrix.app }}
73+
run: |
74+
git clone https://oauth2:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository_owner }}/${{ matrix.app }}.git
75+
cd ${{ matrix.app }}
76+
77+
git config user.email "devtools@kern.ai"
78+
git config user.name "GitHub Actions"
79+
80+
git checkout -b ${{ github.event.pull_request.head.ref }} || git checkout ${{ github.event.pull_request.head.ref }}
81+
git push origin ${{ github.event.pull_request.head.ref }} && git pull origin ${{ github.event.pull_request.head.ref }}
82+
83+
git add requirements/${{ matrix.parent_image_type }}-requirements.txt
84+
git commit -m "ci: update ${{ matrix.parent_image_type }}-requirements.txt"
85+
git push origin ${{ github.event.pull_request.head.ref }}
86+
echo "::notice::${{ matrix.app }} updated to origin/${{ github.event.pull_request.head.ref }}"
87+
88+
gh pr create \
89+
--title "${{ github.event.pull_request.title }}" \
90+
--body "${{ github.event.pull_request.body }}" \
91+
--base dev \
92+
--head ${{ github.event.pull_request.head.ref }} \
93+
--repo ${{ github.repository_owner }}/${{ matrix.app }}
5794
5895
# pi-build:
5996
# name: 'Parent Images: Docker Build'

0 commit comments

Comments
 (0)