Skip to content

Commit

Permalink
CI: update Docker image build logic
Browse files Browse the repository at this point in the history
- Change development image tags to "development" so that branch name and tag name are the same
  (and we don't need any logic to translate between branch names and tag names)
- Also build images for release-1.9 branch
- Also re-build images if their build workflow changes
  • Loading branch information
stsnel committed Feb 29, 2024
1 parent 2782c67 commit 192aa75
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 7 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build-push-image-davrods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
push:
branches:
- 'development'
- 'release-1.9'
paths:
- '.github/workflows/build-push-image-davrods.yml'
- 'docker/images/davrods/**'

jobs:
Expand All @@ -16,6 +18,11 @@ jobs:
contents: read
packages: write
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Check out Yoda repository
uses: actions/checkout@v3
with:
Expand All @@ -36,4 +43,4 @@ jobs:
context: yoda/docker/images/davrods
file: yoda/docker/images/davrods/Dockerfile
push: true
tags: ghcr.io/utrechtuniversity/davrods:dev-1.9
tags: ghcr.io/utrechtuniversity/davrods:${{ steps.extract_branch.outputs.branch }}
9 changes: 8 additions & 1 deletion .github/workflows/build-push-image-eus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
push:
branches:
- 'development'
- 'release-1.9'
paths:
- '.github/workflows/build-push-image-eus.yml'
- 'docker/images/yoda_eus/**'

jobs:
Expand All @@ -16,6 +18,11 @@ jobs:
contents: read
packages: write
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Check out Yoda repository
uses: actions/checkout@v3
with:
Expand All @@ -36,4 +43,4 @@ jobs:
context: yoda/docker/images/yoda_eus
file: yoda/docker/images/yoda_eus/Dockerfile
push: true
tags: ghcr.io/utrechtuniversity/yoda-eus:dev-1.9
tags: ghcr.io/utrechtuniversity/yoda-eus:${{ steps.extract_branch.outputs.branch }}
9 changes: 8 additions & 1 deletion .github/workflows/build-push-image-mailpit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
push:
branches:
- 'development'
- 'release-1.9'
paths:
- '.github/workflows/build-push-image-mailpit.yml'
- 'docker/images/mailpit/**'

jobs:
Expand All @@ -16,6 +18,11 @@ jobs:
contents: read
packages: write
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Check out Yoda repository
uses: actions/checkout@v3
with:
Expand All @@ -37,4 +44,4 @@ jobs:
run: |
cd yoda/docker/images/mailpit
./build.sh
docker push ghcr.io/utrechtuniversity/yoda-mailpit:dev-1.9
docker push ghcr.io/utrechtuniversity/yoda-mailpit:${{ steps.extract_branch.outputs.branch }}
9 changes: 8 additions & 1 deletion .github/workflows/build-push-image-portal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
push:
branches:
- 'development'
- 'release-1.9'
paths:
- '.github/workflows/build-push-image-portal.yml'
- 'docker/images/yoda_portal/**'

jobs:
Expand All @@ -16,6 +18,11 @@ jobs:
contents: read
packages: write
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Check out Yoda repository
uses: actions/checkout@v3
with:
Expand All @@ -36,4 +43,4 @@ jobs:
context: yoda/docker/images/yoda_portal
file: yoda/docker/images/yoda_portal/Dockerfile
push: true
tags: ghcr.io/utrechtuniversity/yoda-portal:dev-1.9
tags: ghcr.io/utrechtuniversity/yoda-portal:${{ steps.extract_branch.outputs.branch }}
9 changes: 8 additions & 1 deletion .github/workflows/build-push-image-provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
push:
branches:
- 'development'
- 'release-1.9'
paths:
- '.github/workflows/build-push-image-provider.yml'
- 'docker/images/yoda_irods_icat/**'
- 'roles/irods_completion/files/irods_completion.sh'
- 'roles/pam_python/files/pam_python.so'
Expand All @@ -19,6 +21,11 @@ jobs:
contents: read
packages: write
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Check out Yoda repository
uses: actions/checkout@v3
with:
Expand All @@ -44,4 +51,4 @@ jobs:
context: yoda/docker/images/yoda_irods_icat
file: yoda/docker/images/yoda_irods_icat/Dockerfile
push: true
tags: ghcr.io/utrechtuniversity/yoda-provider:dev-1.9
tags: ghcr.io/utrechtuniversity/yoda-provider:${{ steps.extract_branch.outputs.branch }}
9 changes: 8 additions & 1 deletion .github/workflows/build-push-image-public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
push:
branches:
- 'development'
- 'release-1.9'
paths:
- '.github/workflows/build-push-image-public.yml'
- 'docker/images/yoda_public/**'
- 'roles/yoda_landingpages/files/**'

Expand All @@ -17,6 +19,11 @@ jobs:
contents: read
packages: write
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Check out Yoda repository
uses: actions/checkout@v3
with:
Expand All @@ -42,4 +49,4 @@ jobs:
context: yoda/docker/images/yoda_public
file: yoda/docker/images/yoda_public/Dockerfile
push: true
tags: ghcr.io/utrechtuniversity/yoda-public:dev-1.9
tags: ghcr.io/utrechtuniversity/yoda-public:${{ steps.extract_branch.outputs.branch }}
9 changes: 8 additions & 1 deletion .github/workflows/build-push-image-web-mock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
push:
branches:
- 'development'
- 'release-1.9'
paths:
- '.github/workflows/build-push-image-web-mock.yml'
- 'docker/images/yoda_web_mock/**'

jobs:
Expand All @@ -16,6 +18,11 @@ jobs:
contents: read
packages: write
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Check out Yoda repository
uses: actions/checkout@v3
with:
Expand All @@ -36,4 +43,4 @@ jobs:
context: yoda/docker/images/yoda_web_mock
file: yoda/docker/images/yoda_web_mock/Dockerfile
push: true
tags: ghcr.io/utrechtuniversity/yoda-web-mock:dev-1.9
tags: ghcr.io/utrechtuniversity/yoda-web-mock:${{ steps.extract_branch.outputs.branch }}

0 comments on commit 192aa75

Please sign in to comment.