Skip to content

Commit

Permalink
Merge pull request #28 from gregcube/workflow-finetune
Browse files Browse the repository at this point in the history
Run update_models on push, adds paths filter
  • Loading branch information
lehors authored Oct 15, 2024
2 parents 668a91d + 61dd389 commit 890fdfc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
push:
branches:
- main
paths:
- 'web/**'
- 'patches/**'
- 'scripts/**'
- 'composer.json'
- 'composer.lock'
workflow_dispatch:
inputs:
environment:
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/update_models.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Update models

on:
pull_request:
types:
- closed
push:
branches:
- main
paths:
- 'models/**'
workflow_dispatch:
inputs:
environment:
Expand Down Expand Up @@ -79,18 +79,17 @@ jobs:
- name: Add server to known hosts
run: ssh-keyscan -H $DEPLOY_HOST >> ~/.ssh/known_hosts

- name: List models on PR merge
if: ${{ github.event_name == 'pull_request' &&
github.event.pull_request.merged == true }}
- name: Check for model changes on push
if: ${{ github.event_name == 'push' }}
run: |
git fetch origin main
git diff \
--name-only \
--diff-filter=AM origin/main...${{ github.sha }} | \
grep '^models/.*\.yml$' > models.txt || true
- name: List models on workflow_dispatch
if: github.event_name == 'workflow_dispatch'
- name: Check for model changes on workflow_dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
git fetch origin ${{ github.ref_name }}
mkdir tmp
Expand Down

0 comments on commit 890fdfc

Please sign in to comment.