Skip to content

Commit 5e785d8

Browse files
committed
build ngf binary
1 parent cf1bbd2 commit 5e785d8

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

.github/workflows/functional.yml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
3434
packages: write # for docker/build-push-action to push to GHCR
3535
id-token: write # for docker/login to login to NGINX registry
36-
runs-on: ${{ github.event_name != 'pull_request' && contains(inputs.image, 'plus') && 'kic-plus' || 'ubuntu-22.04' }}
36+
runs-on: ubuntu-22.04
3737
services:
3838
registry:
3939
image: registry:2
@@ -65,30 +65,28 @@ jobs:
6565
with:
6666
platforms: arm64
6767

68-
- name: Login to GitHub Container Registry
69-
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
70-
if: ${{ github.event_name != 'pull_request' && ! contains(inputs.image, 'plus') }}
71-
with:
72-
registry: ghcr.io
73-
username: ${{ github.repository_owner }}
74-
password: ${{ secrets.GITHUB_TOKEN }}
68+
- name: Output Variables
69+
id: vars
70+
run: echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
7571

76-
- name: Get Id Token
77-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
78-
id: idtoken
72+
- name: Build binary
73+
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
7974
with:
80-
script: |
81-
let id_token = await core.getIDToken()
82-
core.setOutput('id_token', id_token)
83-
if: ${{ github.event_name != 'pull_request' && contains(inputs.image, 'plus')}}
84-
85-
- name: Login to NGINX Registry
86-
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
75+
version: latest
76+
args: ${{ github.ref_type == 'tag' && 'release' || 'build --snapshot' }} --clean
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
GOPATH: ${{ steps.vars.outputs.go_path }}
80+
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
81+
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
82+
AZURE_BUCKET_NAME: ${{ secrets.AZURE_BUCKET_NAME }}
83+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
84+
85+
- name: Fetch Cached Artifacts
86+
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
8787
with:
88-
registry: docker-mgmt.nginx.com
89-
username: ${{ steps.idtoken.outputs.id_token }}
90-
password: ${{ github.actor }}
91-
if: ${{ github.event_name != 'pull_request' && contains(inputs.image, 'plus') }}
88+
path: ${{ github.workspace }}/dist
89+
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
9290

9391
- name: NGF Docker meta
9492
id: ngf-meta

0 commit comments

Comments
 (0)