forked from mlcommons/ck
-
Notifications
You must be signed in to change notification settings - Fork 4
41 lines (36 loc) · 1.35 KB
/
update-script-dockerfiles.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# This workflow will add/update the default dockerfile for any updated CM scripts
name: Dockerfile update for CM scripts
on:
push:
branches: [ "master", "dev" ]
paths:
- 'cm-mlops/script/**_cm.json'
jobs:
dockerfile:
if: github.repository == 'mlcommons/ck'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: getfile
run: |
echo "files=$(git diff --name-only ${{ github.event.before }} | xargs)" >> $GITHUB_OUTPUT
- name: Update dockerfile
run: |
for file in ${{ steps.getfile.outputs.files }}; do
echo $file
done
python3 -m pip install cmind
cm pull repo --url=https://github.com/${{ github.repository }} --checkout=${{ github.ref_name }}
python3 tests/script/process_dockerfile.py ${{ steps.getfile.outputs.files }}
FOLDER=`cm find repo mlcommons@ck | cut -d' ' -f3`
USER=cTuning
git config --global user.name "$USER"
git config --global user.email "$EMAIL"
git remote set-url origin https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com/${{ github.repository }}
git add *.Dockerfile
git diff-index --quiet HEAD || (git commit -am "Updated dockerfile" && git push)