Skip to content

Update images to use new swan image version v0.0.21 #8

Update images to use new swan image version v0.0.21

Update images to use new swan image version v0.0.21 #8

name: Update Child Images
on:
push:
tags:
- base/*
- swan/*
- swan-cern/*
jobs:
update-dockerfiles:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: main
- name: Set Up Git
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
- name: Detect Parent Image Tag
id: detect-tag
run: |
IMAGE_TAG=${GITHUB_REF#refs/tags/}
echo "PARENT_NAME=$(echo $IMAGE_TAG | cut -d / -f 1)" >> $GITHUB_ENV
echo "PARENT_VERSION=$(echo $IMAGE_TAG | cut -d / -f 2)" >> $GITHUB_ENV
- name: Update swan Dockerfile
if: env.PARENT_NAME == 'base'
run: |
sed -i "s/^ARG VERSION_PARENT=.*/ARG VERSION_PARENT=${PARENT_VERSION}/" swan/Dockerfile
git add swan/Dockerfile
- name: Update swan-cern Dockerfile
if: env.PARENT_NAME == 'swan'
run: |
sed -i "s/^ARG VERSION_PARENT=.*/ARG VERSION_PARENT=${PARENT_VERSION}/" swan-cern/Dockerfile
git add swan-cern/Dockerfile
- name: Update prefetcher Dockerfile
if: env.PARENT_NAME == 'swan-cern'
run: |
sed -i "s/^ARG VERSION_PARENT=.*/ARG VERSION_PARENT=${PARENT_VERSION}/" prefetcher/Dockerfile
git add prefetcher/Dockerfile
- name: Commit Changes
run: |
git commit -m "Update images to use new ${PARENT_NAME} image version ${PARENT_VERSION}"
- name: Push Changes and Create PR
uses: peter-evans/create-pull-request@v6
with:
branch: update-${{ env.PARENT_NAME }}-${{ env.PARENT_VERSION }}
title: "Update images to use new ${{ env.PARENT_NAME }} image version ${{ env.PARENT_VERSION }}"
body: "This PR updates the Dockerfiles in the repository to use the new ${{ env.PARENT_NAME }} image version ${{ env.PARENT_VERSION }}."
commit-message: "Update Dockerfiles to use new ${{ env.PARENT_NAME }} image version ${{ env.PARENT_VERSION }}"
token: ${{ secrets.GITHUB_TOKEN }}
delete-branch: true