File tree Expand file tree Collapse file tree 4 files changed +49
-2
lines changed Expand file tree Collapse file tree 4 files changed +49
-2
lines changed Original file line number Diff line number Diff line change
1
+ # This workflow will build a docker container, publish it to Google Container Registry,
2
+
3
+ name : Build and Save to GCR
4
+
5
+ on :
6
+ release :
7
+ types : [created]
8
+
9
+ env :
10
+ PROJECT_ID : ${{ secrets.GCR_PROJECT }}
11
+ IMAGE : ${{ secrets.GCR_IMAGE }}
12
+
13
+ jobs :
14
+ setup-build-publish :
15
+ name : Setup, Build, and Publish
16
+ runs-on : ubuntu-latest
17
+ environment : production
18
+
19
+ steps :
20
+ - name : Checkout
21
+ uses : actions/checkout@v2
22
+
23
+ # Setup gcloud CLI
24
+ -
uses :
google-github-actions/[email protected]
25
+ with :
26
+ service_account_key : ${{ secrets.GCR_KEY }}
27
+ project_id : ${{ secrets.GCR_PROJECT }}
28
+
29
+ # Configure Docker to use the gcloud command-line tool as a credential
30
+ # helper for authentication
31
+ - run : |-
32
+ gcloud --quiet auth configure-docker
33
+
34
+ # Build the Docker image
35
+ - name : Build
36
+ run : make build-test-wrapper
37
+
38
+ # Push the Docker image to Google Container Registry
39
+ - name : Publish
40
+ run : |-
41
+ docker tag "us.gcr.io/$PROJECT_ID/$IMAGE:latest" "us.gcr.io/$PROJECT_ID/$IMAGE:$GITHUB_SHA"
42
+ docker push "us.gcr.io/$PROJECT_ID/$IMAGE:$GITHUB_SHA"
43
+
Original file line number Diff line number Diff line change 25
25
test :
26
26
go test -race -v --cover ./...
27
27
28
+ build-test-wrapper :
29
+ $(MAKE ) -C test_wrapper build
28
30
29
31
# Format go code and error if any changes are made
30
32
PHONY+ = format
Original file line number Diff line number Diff line change
1
+
2
+
1
3
install :
2
4
go get github.com/deepmap/oapi-codegen/cmd/
[email protected]
3
5
@@ -7,4 +9,4 @@ generate:
7
9
oapi-codegen -generate types -package=restapi ./test_wrapper_openapi/sdk_wrapper-v1.yaml > ./restapi/test_wrapper_types.gen.go
8
10
9
11
build :
10
- docker build -t go_sdk_wrapper :latest -f ./docker/Dockerfile .
12
+ docker build -t us.gcr.io/ ${PROJECT_ID} / ${IMAGE} :latest -f ./docker/Dockerfile .
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ func main() {
28
28
viper .SetDefault ("BaseURL" , "http://localhost/api/1.0" )
29
29
30
30
viper .SetDefault ("SdkKey" , "1bca46aa-0abe-4b22-a5f0-904422db288b" )
31
- viper .SetDefault ("EnableStreaming" , false )
31
+ viper .SetDefault ("EnableStreaming" , true )
32
32
viper .BindEnv ("WrapperHostname" , "WRAPPER_HOSTNAME" )
33
33
viper .BindEnv ("WrapperPort" , "WRAPPER_PORT" )
34
34
viper .BindEnv ("BaseURL" , "SDK_BASE_URL" )
You can’t perform that action at this time.
0 commit comments