-
Notifications
You must be signed in to change notification settings - Fork 2k
61 lines (52 loc) · 1.76 KB
/
build-test-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@f112390a2df9932162083945e46d439060d66ec2 # v2.1.4
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@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: gcr.io
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Build Test-Runner Container
uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.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