Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/go_app_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ on:
description: 'GOPRIVATE env for go commands'
required: false
type: string
APISPEC_PATH:
description: 'The path to an Open API spec. Will have info.version updated with the release version'
required: false
type: string
APISPEC_BUILD_PATH:
description: 'A location to copy the APISPEC_PATH file to'
required: false
type: string
secrets:
GH_CI_PAT:
description: 'Token password for GitHub auth'
Expand Down Expand Up @@ -119,6 +127,16 @@ jobs:
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# Update the openapi file to use the release version
- name: Add release version to Open API file
uses: mikefarah/yq@master
if: ${{ inputs.APISPEC_PATH }}
with:
cmd: yq -i '.info.version="${{ steps.release.outputs.version }}"' ${{ inputs.APISPEC_PATH }}
# Move openapi file to the correct location and override version
- name: Copy Open API file
if: ${{ inputs.APISPEC_PATH && inputs.APISPEC_BUILD_PATH}}
run: cat ${{ inputs.APISPEC_PATH }} && cp ${{ inputs.APISPEC_PATH }} ${{ inputs.APISPEC_BUILD_PATH}}
# Build and push the image.
- name: Build and Push to Artifact Registry and Container Registry
uses: docker/build-push-action@v3
Expand Down