Skip to content

Build Test Image

Build Test Image #75

name: Build Test Image
on:
workflow_dispatch:
inputs:
force:
description: "Force rebuild of test image"
required: false
default: "false"
schedule:
- cron: "0 3 * * *" # run every day at 03:00 UTC
defaults:
run:
shell: bash
concurrency:
group: ${{ github.ref_name }}-build-test
cancel-in-progress: true
permissions:
contents: read
id-token: write
jobs:
build:
name: Build test image
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3
with:
token_format: access_token
workload_identity_provider: ${{ secrets.GCR_WORKLOAD_IDENTITY }}
service_account: ${{ secrets.GCR_SERVICE_ACCOUNT }}
- name: Login to GCR
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: gcr.io
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Build Test-Runner Container
uses: docker/build-push-action@1a162644f9a7e87d8f4b053101d1d9a712edc18c # v6.3.0
with:
file: tests/Dockerfile
context: "."
cache-from: type=gha,scope=test-runner
tags: |
gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/test-runner:${{ hashFiles('./tests/requirements.txt') }}
gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/test-runner:latest
pull: true
push: true