Skip to content

Commit

Permalink
Don't try to push to docker.io/osg-htc
Browse files Browse the repository at this point in the history
  • Loading branch information
matyasselmeci committed Oct 1, 2024
1 parent edaf78b commit a47e0bb
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build-sw-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Push Docker image

on:
push:
branches: ['master']
branches: ['master', 'el9']
repository_dispatch:
types:
- dispatch-build
Expand Down Expand Up @@ -36,10 +36,22 @@ jobs:
REPO: ${{ matrix.repo }}
TIMESTAMP: ${{ needs.make-date-tag.outputs.dtag }}
run: |
docker_repo=${GITHUB_REPOSITORY/osg-htc\/docker-/opensciencegrid/}
baseref=$(basename "$GITHUB_REF")
if [[ $baseref == master ]]; then
docker_repo=opensciencegrid/osg-repo-scripts
registries=(hub.opensciencegrid.org docker.io)
tag_prefix=$REPO
elif [[ $baseref == el9 ]]; then
docker_repo=osg-htc/osg-repo-scripts
registries=(hub.opensciencegrid.org)
tag_prefix=el9
else
echo >&2 "No image name rule for ref '$GITHUB_REF'"
exit 1
fi
tag_list=()
for registry in hub.opensciencegrid.org docker.io; do
for image_tag in "$REPO" "$REPO-$TIMESTAMP"; do
for registry in ${registries[*]}; do
for image_tag in "${tag_prefix}" "${tag_prefix}-$TIMESTAMP"; do
tag_list+=("$registry/$docker_repo":"$image_tag")
done
done
Expand Down

0 comments on commit a47e0bb

Please sign in to comment.