Skip to content

Commit 9f9cc89

Browse files
committed
Update cache-from and cache-to in build.yml
1 parent 5590673 commit 9f9cc89

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
platforms:
77
required: true
88
type: string
9-
build_os:
9+
build-os:
1010
required: false
1111
type: string
1212
default: ''
@@ -124,12 +124,12 @@ jobs:
124124
flavor: |
125125
latest=${{ (inputs.tag != '' && 'true') || 'auto' }}
126126
tags: |
127-
type=semver,pattern={{version}},suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }}
128-
type=edge,suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }}
129-
type=schedule,suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }}
130-
type=ref,event=pr,suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }}
131-
type=ref,event=branch,suffix=-rc${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }},enable=${{ startsWith(github.ref, 'refs/heads/release') && inputs.tag == '' }}
132-
type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }},suffix=${{ inputs.build_os != '' && format('-{0}', inputs.build_os) || '' }}
127+
type=semver,pattern={{version}},suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
128+
type=edge,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
129+
type=schedule,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
130+
type=ref,event=pr,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
131+
type=ref,event=branch,suffix=-rc${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }},enable=${{ startsWith(github.ref, 'refs/heads/release') && inputs.tag == '' }}
132+
type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }},suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
133133
labels: |
134134
org.opencontainers.image.documentation=https://docs.nginx.com/nginx-gateway-fabric
135135
org.opencontainers.image.vendor=NGINX Inc <[email protected]>
@@ -147,16 +147,16 @@ jobs:
147147
- name: Build Docker Image
148148
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
149149
with:
150-
file: ${{ inputs.build_os != '' && format('build/{0}/Dockerfile{1}', inputs.build_os, inputs.image == 'nginx' && '.nginx' || inputs.image == 'plus' && '.nginxplus' || '') || format('build/Dockerfile{0}', inputs.image == 'nginx' && '.nginx' || inputs.image == 'plus' && '.nginxplus' || '') }}
150+
file: ${{ inputs.build-os != '' && format('build/{0}/Dockerfile{1}', inputs.build-os, inputs.image == 'nginx' && '.nginx' || inputs.image == 'plus' && '.nginxplus' || '') || format('build/Dockerfile{0}', inputs.image == 'nginx' && '.nginx' || inputs.image == 'plus' && '.nginxplus' || '') }}
151151
context: "."
152152
target: ${{ inputs.image == 'ngf' && 'goreleaser' || '' }}
153153
tags: ${{ steps.meta.outputs.tags }}
154154
labels: ${{ steps.meta.outputs.labels }}
155155
annotations: ${{ steps.meta.outputs.annotations }}
156156
push: ${{ !inputs.dry_run }}
157157
platforms: ${{ inputs.platforms }}
158-
cache-from: type=gha,scope=${{ inputs.image }}
159-
cache-to: type=gha,scope=${{ inputs.image }},mode=max
158+
cache-from: type=gha,scope=${{ inputs.image }}${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
159+
cache-to: type=gha,scope=${{ inputs.image }}${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }},mode=max
160160
pull: true
161161
no-cache: ${{ github.event_name != 'pull_request' }}
162162
sbom: true
@@ -165,7 +165,7 @@ jobs:
165165
NJS_DIR=internal/controller/nginx/modules/src
166166
NGINX_CONF_DIR=internal/controller/nginx/conf
167167
BUILD_AGENT=gha
168-
BUILD_OS=${{ inputs.build_os }}
168+
build-os=${{ inputs.build-os }}
169169
secrets: |
170170
${{ contains(inputs.image, 'plus') && format('"nginx-repo.crt={0}"', secrets.NGINX_CRT) || '' }}
171171
${{ contains(inputs.image, 'plus') && format('"nginx-repo.key={0}"', secrets.NGINX_KEY) || '' }}

.github/workflows/conformance.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ jobs:
133133
NJS_DIR=internal/controller/nginx/modules/src
134134
NGINX_CONF_DIR=internal/controller/nginx/conf
135135
BUILD_AGENT=gha
136-
secrets: |
137-
${{ contains(inputs.image, 'plus') && format('"nginx-repo.crt={0}"', secrets.NGINX_CRT) || '' }}
138-
${{ contains(inputs.image, 'plus') && format('"nginx-repo.key={0}"', secrets.NGINX_KEY) || '' }}
139136
140137
- name: Update Go Modules
141138
if: ${{ github.event_name == 'schedule' }}

.github/workflows/functional.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ jobs:
117117
NJS_DIR=internal/controller/nginx/modules/src
118118
NGINX_CONF_DIR=internal/controller/nginx/conf
119119
BUILD_AGENT=gha
120-
secrets: |
121-
${{ contains(inputs.image, 'plus') && format('"nginx-repo.crt={0}"', secrets.NGINX_CRT) || '' }}
122-
${{ contains(inputs.image, 'plus') && format('"nginx-repo.key={0}"', secrets.NGINX_KEY) || '' }}
123120
124121
- name: Setup license file for plus
125122
if: ${{ inputs.image == 'plus' }}

0 commit comments

Comments
 (0)