Skip to content

Commit 9f7cfcf

Browse files
committed
Use own runs-on instead of GitHub Hosted runners
1 parent 95f0245 commit 9f7cfcf

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎.github/actions/shared-steps/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ runs:
249249
esac
250250
251251
- name: Check nested virtualization support
252-
if: inputs.arch == 'x86_64' && inputs.type != 'vagrant_virtualbox' && inputs.type != 'vagrant_vmware'
252+
if: inputs.arch == 'x86_64' && inputs.type != 'vagrant_virtualbox' && inputs.type != 'vagrant_vmware' && inputs.runner != 'aws-ec2'
253253
shell: bash
254254
run: |
255255
# Check nested virtualization support

‎.github/runs-on.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_extends: .github

‎.github/workflows/build.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ jobs:
177177
name: ${{ matrix.variant }} ${{ matrix.matrix_gh }} image
178178
needs: [init-data]
179179
if: ${{ needs.init-data.outputs.matrix_gh != '[]' }}
180-
runs-on: ubuntu-24.04
180+
runs-on: "${{ github.repository_owner == 'AlmaLinux' && format('runs-on={0}/family=c7i.metal-24xl+c7a.metal-48xl+*8gd.metal*/image=ubuntu24-full-x64', github.run_id) || 'ubuntu-24.04' }}"
181181
strategy:
182182
fail-fast: false
183183
matrix:
@@ -234,7 +234,7 @@ jobs:
234234
upload_to_s3: ${{ inputs.upload_to_s3 }}
235235
notify_mattermost: ${{ inputs.notify_mattermost }}
236236
run_test: true # Do image simple testing and generate installed packages list (vagrant_* only)
237-
runner: gh_hosted
237+
runner: ${{ github.repository_owner == 'AlmaLinux' && 'aws-ec2' || 'gh_hosted' }}
238238

239239
start-self-hosted-runner:
240240
name: ${{ matrix.variant }} ${{ matrix.matrix_sh }} runner
@@ -279,7 +279,7 @@ jobs:
279279

280280
steps:
281281
- name: Setup and start runner
282-
if: inputs.self_hosted_runner == 'aws-ec2'
282+
if: inputs.self_hosted_runner == 'aws-ec2' && github.repository_owner != 'AlmaLinux'
283283
uses: NextChapterSoftware/ec2-action-builder@v1.10
284284
with:
285285
github_token: ${{ secrets.GIT_HUB_TOKEN }}
@@ -307,7 +307,7 @@ jobs:
307307
name: ${{ matrix.variant }} ${{ matrix.matrix_sh }} image
308308
if: ${{ inputs.self-hosted && needs.init-data.outputs.matrix_sh != '[]' }}
309309
needs: [init-data, start-self-hosted-runner]
310-
runs-on: ${{ inputs.self_hosted_runner == 'aws-ec2' && github.run_id || matrix.matrix_sh }}
310+
runs-on: ${{ github.repository_owner == 'AlmaLinux' && ( contains(matrix.matrix_sh, 'x86_64') && format('runs-on={0}/family=c5n.metal/ami={1}', github.run_id, vars.EC2_AMI_ID_AL9_X86_64 ) || format('runs-on={0}/family=a1.metal/image=almalinux-9-aarch64', github.run_id) ) || ( inputs.self_hosted_runner == 'aws-ec2' && github.run_id || matrix.matrix_sh ) }}
311311
strategy:
312312
fail-fast: false
313313
matrix:
@@ -383,4 +383,4 @@ jobs:
383383
upload_to_s3: ${{ inputs.upload_to_s3 }}
384384
notify_mattermost: ${{ inputs.notify_mattermost }}
385385
run_test: true # Do image simple testing and generate installed packages list (vagrant_* only)
386-
runner: self_hosted
386+
runner: ${{ github.repository_owner == 'AlmaLinux' && 'aws-ec2' || 'self_hosted' }}

0 commit comments

Comments
 (0)