-
Notifications
You must be signed in to change notification settings - Fork 3
127 lines (114 loc) · 4.37 KB
/
release-service-stream.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: 'Release: Stream Service'
on:
push:
tags:
- 'production-stream-v**'
- 'dev-stream-v**'
env:
# DockerHub login
DOCKERHUB_USER: "keboolabot"
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
IMAGE_TAG: ${{ github.ref_name }}
IMAGE_NAME: "keboola/stream-service"
ECR_REGION: "us-east-1"
ECR_REPOSITORY: "keboola/stream-service"
ECR_PUSH_ROLE: "arn:aws:iam::968984773589:role/kbc-ecr-StreamServicePushRole-k57lBKJxl9Dr"
ACR_REGISTRY: "keboola.azurecr.io"
ACR_REPOSITORY: "stream-service"
ACR_USERNAME: "stream-service-push"
GCP_REGISTRY: "us-central1-docker.pkg.dev"
GCP_IDENTITY_PROVIDER: "projects/388088979044/locations/global/workloadIdentityPools/github/providers/github"
GCP_ACCOUNT: "keboola-as-code-ci-push@keboola-prod-artifacts.iam.gserviceaccount.com"
GCP_REPOSITORY: "keboola-prod-artifacts/keboola-as-code/stream-service"
jobs:
test-lint:
name: "Lint"
secrets: inherit
uses: ./.github/workflows/test-lint.yml
test-unit:
name: "Unit Tests"
secrets: inherit
uses: ./.github/workflows/test-unit.yml
with:
without-cache: true
package-exception-regex: "./internal/pkg/service/appsproxy|./internal/pkg/service/templates|./internal/pkg/service/cli"
test-e2e-service-stream:
name: "E2E: Stream"
secrets: inherit
uses: ./.github/workflows/test-e2e-service-stream.yml
# test-k8s-service-stream:
# name: "K8S: Stream"
# secrets: inherit
# uses: ./.github/workflows/test-k8s-service-stream.yml
build-and-push-api-image:
name: "Build & Push Image"
runs-on: ubuntu-latest
permissions:
id-token: write
needs:
- test-lint
- test-unit
- test-e2e-service-stream
# - test-k8s-service-stream
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker login
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USER }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Build Service image
uses: docker/build-push-action@v6
with:
load: true
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
context: .
file: provisioning/stream/docker/service/Dockerfile
- name: Build Service image with race detector
uses: docker/build-push-action@v6
with:
load: true
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}-race
context: .
file: provisioning/stream/docker/service/race/Dockerfile
- name: Push Service image to Amazon ECR, Azure ACR and GCP GAR
uses: ./.github/actions/push-image-aws-azure-gcp
with:
imageName: ${{ env.IMAGE_NAME }}
imageTag: ${{ env.IMAGE_TAG }}
ecrRegion: ${{ env.ECR_REGION }}
ecrRepository: ${{ env.ECR_REPOSITORY }}
ecrPushRole: ${{ env.ECR_PUSH_ROLE }}
gcpRegistry: ${{ env.GCP_REGISTRY }}
gcpRepository: ${{ env.GCP_REPOSITORY }}
gcpIdentityProvider: ${{ env.GCP_IDENTITY_PROVIDER }}
gcpServiceAccount: ${{ env.GCP_ACCOUNT }}
acrRegistry: ${{ env.ACR_REGISTRY }}
acrRepository: ${{ env.ACR_REPOSITORY }}
acrUsername: ${{ env.ACR_USERNAME }}
acrPassword: ${{ secrets.STREAM_ACR_PASSWORD }}
- name: Push Service image with race detector to Amazon ECR, Azure ACR and GCP GAR
uses: ./.github/actions/push-image-aws-azure-gcp
with:
imageName: ${{ env.IMAGE_NAME }}
imageTag: ${{ env.IMAGE_TAG }}-race
ecrRegion: ${{ env.ECR_REGION }}
ecrRepository: ${{ env.ECR_REPOSITORY }}
ecrPushRole: ${{ env.ECR_PUSH_ROLE }}
gcpRegistry: ${{ env.GCP_REGISTRY }}
gcpRepository: ${{ env.GCP_REPOSITORY }}
gcpIdentityProvider: ${{ env.GCP_IDENTITY_PROVIDER }}
gcpServiceAccount: ${{ env.GCP_ACCOUNT }}
acrRegistry: ${{ env.ACR_REGISTRY }}
acrRepository: ${{ env.ACR_REPOSITORY }}
acrUsername: ${{ env.ACR_USERNAME }}
acrPassword: ${{ secrets.STREAM_ACR_PASSWORD }}
- name: Trigger image tag update
uses: ./.github/actions/trigger-image-tag-update
with:
helm-chart: "stream"
image-tag: ${{ env.IMAGE_TAG }}
github-app-private-key: ${{ secrets.GITOPS_KBC_STACKS_TRIGGER_APP_PVK }}