forked from actions/runner-images
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.64 KB
/
runner-image-scale-set-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build and Push Actions Runner scale-set image
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "images/ubuntu/dockerfiles-scaleset/**"
pull_request: # to test the workflow
branches:
- main
paths:
- "images/ubuntu/dockerfiles-scaleset/**"
permissions:
contents: write
packages: write
id-token: write
jobs:
build:
strategy:
matrix:
base_image: [22.04-devel, 24.04-devel]
runs-on: ubuntu-xl
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
show-progress: false
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
fetch-depth: 1
- name: Set up Git
shell: bash
env:
ACCESS_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
run: |
go env -w GOPRIVATE="github.com/devzero-inc/*"
git config --global url."https://x-access-token:$ACCESS_TOKEN@github.com/".insteadOf "https://github.com/"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/#-action@v3
with:
username: ${{ vars.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build and Push Docker image
shell: bash
run: |
cd images/ubuntu/dockerfiles-scaleset
TAG=${{ matrix.base_image }} BASE_IMAGE=devzeroinc/gha-runner-image-ubuntu:${{ matrix.base_image}} \
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
make build-image
else
make push
fi