Skip to content

Commit f084b00

Browse files
committed
.github: workflows: Use Hetzner Ubuntu mirror on Hetzner runners only
The Hetzner Ubuntu mirror is only available within the Hetzner network and thereby Hetzner-hosted runners. This commit updates the CI workflow to specify the Hetzner Ubuntu mirror only if the scheduled runners are hosted by Hetzner. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
1 parent d0ed61a commit f084b00

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ jobs:
4848
steps:
4949
- name: Print cloud service information
5050
run: |
51-
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}"
52-
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}"
53-
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
51+
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}"
52+
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}"
53+
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
5454
5555
- name: Configure temporary directory
5656
run: |
@@ -126,17 +126,27 @@ jobs:
126126
type=ref,event=tag
127127
type=ref,event=pr
128128
129+
- name: Generate base image build arguments
130+
id: buildarg_base
131+
run: |
132+
{
133+
echo "args<<EOF"
134+
if [ "${ZEPHYR_RUNNER_CLOUD_PROVIDER}" == "Hetzner" ]; then
135+
echo "UBUNTU_MIRROR_ARCHIVE=mirror.hetzner.com/ubuntu/packages"
136+
echo "UBUNTU_MIRROR_SECURITY=mirror.hetzner.com/ubuntu/security"
137+
echo "UBUNTU_MIRROR_PORTS=mirror.hetzner.com/ubuntu-ports/packages"
138+
fi
139+
echo "EOF"
140+
} >> $GITHUB_OUTPUT
141+
129142
- name: Build base image
130143
uses: redhat-actions/buildah-build@v2
131144
with:
132145
context: .
133146
containerfiles: Dockerfile.base
134147
tags: ${{ steps.meta_base.outputs.tags }}
135148
labels: ${{ steps.meta_base.outputs.labels }}
136-
build-args: |
137-
UBUNTU_MIRROR_ARCHIVE=mirror.hetzner.com/ubuntu/packages
138-
UBUNTU_MIRROR_SECURITY=mirror.hetzner.com/ubuntu/security
139-
UBUNTU_MIRROR_PORTS=mirror.hetzner.com/ubuntu-ports/packages
149+
build-args: ${{ steps.buildarg_base.outputs.args }}
140150

141151
- name: Build CI image
142152
uses: redhat-actions/buildah-build@v2
@@ -192,9 +202,9 @@ jobs:
192202
steps:
193203
- name: Print cloud service information
194204
run: |
195-
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}"
196-
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}"
197-
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
205+
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}"
206+
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}"
207+
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
198208
199209
- name: Configure temporary directory
200210
run: |

0 commit comments

Comments
 (0)