5
5
paths :
6
6
- ' ci/dockerfiles/**'
7
7
- ' .github/workflows/image.yml'
8
+ - ' .tool-versions'
8
9
pull_request :
9
10
paths :
10
11
- ' ci/dockerfiles/**'
11
12
- ' .github/workflows/image.yml'
13
+ - ' .tool-versions'
12
14
workflow_dispatch :
13
15
14
16
env :
15
17
REGISTRY : ghcr.io
16
- IMAGE_NAME : ${{ github.repository }}
17
-
18
18
jobs :
19
+ build-and-push-devbox-image :
20
+ runs-on : ubuntu-latest
21
+ permissions :
22
+ contents : read
23
+ packages : write
24
+ name : Build and Push app-autoscaler-release-devbox
25
+ env :
26
+ IMAGE_NAME : ${{ github.repository }}-devbox
27
+ steps :
28
+ - name : Checkout repository
29
+ uses : actions/checkout@v4
30
+
31
+ - name : Log in to the Container registry
32
+ uses : docker/login-action@v3
33
+ with :
34
+ registry : ${{ env.REGISTRY }}
35
+ username : ${{ github.actor }}
36
+ password : ${{ secrets.GITHUB_TOKEN }}
37
+
38
+ - name : Extract metadata (tags, labels) for Docker
39
+ id : meta
40
+ uses : docker/metadata-action@v5
41
+ with :
42
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43
+
44
+ - name : Build and push
45
+ id : build-and-push
46
+ uses : docker/build-push-action@v5
47
+ with :
48
+ context : .
49
+ file : ci/dockerfiles/autoscaler-devbox/Dockerfile
50
+ push : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
51
+ tags : ${{ steps.meta.outputs.tags }}
52
+ labels : ${{ steps.meta.outputs.labels }}
53
+ cache-from : type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main
54
+
19
55
build-and-push-image :
20
56
runs-on : ubuntu-latest
21
- container : jetpackio/devbox:latest@sha256:3d164648f5ca0fa66cd080ee7c895af54e0a3ec19e19b232a2fea21628e82cfb
22
57
permissions :
23
58
contents : read
24
59
packages : write
@@ -29,40 +64,42 @@ jobs:
29
64
matrix :
30
65
image_suffix : ["tools"]
31
66
name : Build and Push app-autoscaler-release-${{ matrix.image_suffix }}
67
+ env :
68
+ IMAGE_NAME : ${{ github.repository }}
32
69
steps :
33
70
- name : Checkout repository
34
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
71
+ uses : actions/checkout@v4
35
72
36
73
- name : Log in to the Container registry
37
- uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
74
+ uses : docker/login-action@v3
38
75
with :
39
76
registry : ${{ env.REGISTRY }}
40
77
username : ${{ github.actor }}
41
78
password : ${{ secrets.GITHUB_TOKEN }}
42
79
43
80
- name : Extract metadata (tags, labels) for Docker
44
81
id : meta
45
- uses : docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5
82
+ uses : docker/metadata-action@v5
46
83
with :
47
84
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.image_suffix }}
48
85
49
86
- name : Get ginkgo version from autoscaler-release
50
87
id : ginkgo
51
88
run : |
52
- version=$(devbox info ginkgo | head --lines=1 | cut --field= 2 --delimiter= " ")
53
- echo "GINKGO version from devbox: '${version}'"
89
+ version=$(grep " ginkgo " .tool-versions| cut -f 2 -d " ")
90
+ echo "GINKGO version from .tool-versions: \ '${version}\ '"
54
91
echo "version=${version}" >> "$GITHUB_OUTPUT"
55
92
56
93
- id : get-golang-version
57
94
shell : bash
58
95
run : |
59
- version=$(devbox info go | head --lines=1 | cut --field= 2 --delimiter= " ")
60
- echo "Go version from devbox: '${version}'"
96
+ version=$(grep "golang " .tool-versions| cut -f 2 -d " ")
97
+ echo "Go version from .tool-versions: \ '${version}\ '"
61
98
echo "version=${version}" >> "$GITHUB_OUTPUT"
62
99
63
100
- name : Build and push
64
101
id : build-and-push
65
- uses : docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6
102
+ uses : docker/build-push-action@v5
66
103
with :
67
104
context : ci/dockerfiles/autoscaler-${{ matrix.image_suffix }}
68
105
push : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
0 commit comments