Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ on:
branches:
- pipeline
workflow_dispatch: # This triggers the workflow when a webhook is received

inputs:
branch:
description: 'The branch of the submodule the workflow was triggered for'
required: true
type: string
repository:
description: 'The repository of the submodule the workflow was triggered for'
required: true
type: string

jobs:
build:
Expand Down Expand Up @@ -35,15 +43,20 @@ jobs:

- name: Push to main
run: |
cp -R target/* main
rsync -a --delete --exclude 'img/' --exclude 'pom.xml' --exclude 'README*' --exclude 'LICENSE' target/ main/
cd main
rm -rf build openMINDS.egg-info
git config --global user.email "openminds@ebrains.eu"
git config --global user.name "openMINDS pipeline"
if [[ $(git add . --dry-run | wc -l) -gt 0 ]]; then
git add .
git commit -m "build triggered by submodule ${{ inputs.repository }} version ${{ inputs.branch }}"
if [[ $(git add -A --dry-run | wc -l) -gt 0 ]]; then
git add -A
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
git commit -m "build triggered by submodule ${{ inputs.repository }} version ${{ inputs.branch }}"
else
git commit -m "build triggered by ${{ github.event_name }}"
fi
git push -f
else
echo "Nothing to commit"
fi
fi