chore(gcp): Adding STRONG_COOKIE_AFFINITY in gcp LB model (#10124) #272
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Branch Build | |
on: | |
push: | |
branches: | |
- master | |
- release-* | |
env: | |
GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx2g -Xms2g | |
CONTAINER_REGISTRY: us-docker.pkg.dev/spinnaker-community/docker | |
NODE_VERSION: 14.21.3 | |
permissions: | |
contents: read | |
jobs: | |
branch-build: | |
# Only run this on repositories in the 'spinnaker' org, not on forks. | |
if: startsWith(github.repository, 'spinnaker/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Get yarn cache | |
id: yarn-cache | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
cache: 'gradle' | |
- name: Prepare build variables | |
id: build_variables | |
run: | | |
echo REPO=${GITHUB_REPOSITORY##*/} >> $GITHUB_OUTPUT | |
echo VERSION="$(git describe --tags --abbrev=0 --match="v[0-9]*" | cut -c2-)-dev-${GITHUB_REF_NAME}-$(git rev-parse --short HEAD)-$(date --utc +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT | |
- name: Build | |
env: | |
ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }} | |
run: ./gradlew build --stacktrace | |
- name: Login to GAR | |
# Only run this on repositories in the 'spinnaker' org, not on forks. | |
if: startsWith(github.repository, 'spinnaker/') | |
uses: docker/login-action@v3 | |
# use service account flow defined at: https://github.com/docker/login-action#service-account-based-authentication-1 | |
with: | |
registry: us-docker.pkg.dev | |
username: _json_key | |
password: ${{ secrets.GAR_JSON_KEY }} | |
- name: Build and publish slim container image | |
# Only run this on repositories in the 'spinnaker' org, not on forks. | |
if: startsWith(github.repository, 'spinnaker/') | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: Dockerfile.slim | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
"${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ github.ref_name }}-latest-unvalidated" | |
"${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}-unvalidated" | |
"${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ github.ref_name }}-latest-unvalidated-slim" | |
"${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}-unvalidated-slim" | |
- name: Build and publish ubuntu container image | |
# Only run this on repositories in the 'spinnaker' org, not on forks. | |
if: startsWith(github.repository, 'spinnaker/') | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: Dockerfile.ubuntu | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
"${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ github.ref_name }}-latest-unvalidated-ubuntu" | |
"${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}-unvalidated-ubuntu" |