Skip to content

Commit

Permalink
Staged images 1 GitHub workflows (#727)
Browse files Browse the repository at this point in the history
* remove old workflow

* add workflows

* update makefile for new workflows

* feat: improve workflows

moving inline with changes to the fork.

* Adds latest and v1 tags to master
* registry is the whole url now.

* fix: add mamba to list of ignored packages

* Update docker-pull-test.yaml
  • Loading branch information
EveningStarlight authored Jan 22, 2025
1 parent 75be8ad commit 7c4f691
Show file tree
Hide file tree
Showing 10 changed files with 795 additions and 251 deletions.
247 changes: 0 additions & 247 deletions .github/workflows/build_push.yaml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/check-diff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Check for changes in subdirectory

on:
workflow_call:
inputs:
directory:
description: The directory of the image files
required: true
type: string
parent-image-is-diff:
description: Parent image has been changed?
required: true
type: string
branch-name:
description: The name of the current branch
required: true
type: string
outputs:
is-diff:
description: Is there a difference between the master branch and the current branch
value: ${{ jobs.check-diff.outputs.is-diff }}

jobs:
check-diff:
runs-on: ubuntu-latest
outputs:
is-diff: ${{ steps.check-changes.outputs.is-diff }}

steps:
- uses: actions/checkout@v4

- name: Fetch master branch
run: |
git fetch origin master
- name: Check for changes
id: check-changes
run: | # Check for changes excluding README.md
if [ "${{ inputs.branch-name }}" == "master" ]; then
echo "Always build master"
echo "is-diff=true" >> $GITHUB_OUTPUT
elif [ "${{ inputs.parent-image-is-diff }}" == "true" ]; then
echo "Parent is diff"
echo "is-diff=true" >> $GITHUB_OUTPUT
# Check if the subdirectory exists in the base branch
elif ! git ls-tree -d origin/master -- "images/${{ inputs.directory }}" >/dev/null 2>&1; then
echo "Subdirectory does not exist in the base branch"
echo "is-diff='true'" >> $GITHUB_OUTPUT
else
CHANGES=$(git diff --name-only origin/master HEAD -- "images/${{ inputs.directory }}" | grep -v "README.md" || true)
NEW_FILES=$(git diff --name-only --diff-filter=A origin/master HEAD -- "images/${{ inputs.directory }}" | grep -v "README.md" || true)
CHANGES="${CHANGES}${NEW_FILES}"
if [ -n "$CHANGES" ]; then
echo "Changes detected (excluding README.md)"
echo "is-diff=true" >> $GITHUB_OUTPUT
else
echo "No changes detected"
echo "is-diff=false" >> $GITHUB_OUTPUT
fi
fi
Loading

0 comments on commit 7c4f691

Please sign in to comment.