Skip to content

Commit 73dbe59

Browse files
authored
feat: github workflows to build and push (to GCP Artifact Reg) images (#79)
* only validate if this workflow files changes (validate test data) * workflows to build and push docker images for the testing-api and sdk-test-runner
1 parent 3130bd4 commit 73dbe59

File tree

4 files changed

+102
-1
lines changed

4 files changed

+102
-1
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and push SDK Test Runner
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
description: 'Version string for SDK Test Runner release'
8+
type: string
9+
required: true
10+
docker_context:
11+
type: string
12+
description: 'Directory where dockerfile exists'
13+
required: true
14+
image_name:
15+
type: string
16+
description: 'Docker image name'
17+
required: true
18+
19+
env:
20+
VERSION: 1.1.0
21+
22+
PROJECT_ID: ${{ vars.SDK_TESTING_PROJECT_ID }}
23+
REGION: ${{ vars.SDK_TESTING_REGION }}
24+
GAR_LOCATION: ${{ vars.SDK_TESTING_REGION }}-docker.pkg.dev/${{ vars.SDK_TESTING_PROJECT_ID }}/sdk-testing
25+
26+
27+
jobs:
28+
build-and-upload:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: "Checkout"
32+
uses: actions/checkout@v3
33+
34+
# Set up gCloud
35+
- id: "auth"
36+
uses: "google-github-actions/auth@v1"
37+
with:
38+
credentials_json: "${{ secrets.SERVICE_ACCOUNT_KEY }}"
39+
40+
- name: "Set up Cloud SDK"
41+
uses: "google-github-actions/setup-gcloud@v1"
42+
43+
- name: "Use gcloud CLI"
44+
run: "gcloud info"
45+
46+
# Allow docker access to the GAR
47+
- name: "Docker auth"
48+
run: |-
49+
gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet
50+
51+
# Build and push
52+
- name: Build and export
53+
uses: docker/build-push-action@v6
54+
with:
55+
push: true
56+
context: ${{ inputs.docker_context }}
57+
tags: ${{ env.GAR_LOCATION }}/${{ inputs.image_name }}:latest,${{ env.GAR_LOCATION }}/${{ inputs.image_name }}:${{ env.VERSION }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build and push SDK Test Runner
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version string for SDK Test Runner release'
8+
required: true
9+
default: '1.0.0'
10+
11+
push:
12+
paths:
13+
.github/workflows/release-sdk-test-runner.yml
14+
15+
jobs:
16+
build-and-upload:
17+
uses: ./.github/workflows/build-and-push.yml
18+
with:
19+
version: ${{ inputs.version }}
20+
docker_context: ./package-testing/sdk-test-runner
21+
image_name: sdk-test-runner
22+
secrets: inherit
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build and push Testing API
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version string for SDK Testing API release'
8+
required: true
9+
default: '1.0.0'
10+
11+
push:
12+
paths:
13+
.github/workflows/release-sdk-testing-api.yml
14+
15+
jobs:
16+
build-and-upload:
17+
uses: ./.github/workflows/build-and-push.yml
18+
with:
19+
version: ${{ inputs.version }}
20+
docker_context: ./package-testing/testing-api
21+
image_name: testing-api
22+
secrets: inherit

.github/workflows/validate-test-data.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
pull_request:
66
paths:
7-
- '.github/workflows/**'
7+
- '.github/workflows/validate-test-data.yml'
88
- 'ufc/tests/**'
99
push:
1010
branches:

0 commit comments

Comments
 (0)