Skip to content

Commit fed157e

Browse files
committed
Dispatch to lambda image wf
1 parent ad99c42 commit fed157e

3 files changed

Lines changed: 29 additions & 25 deletions

File tree

‎.github/workflows/on-api-release.yml‎

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,36 @@ jobs:
4444
password: "${{env.GITHUB_PUSH_TOKEN}}"
4545
buildargs: INTERSCRIPT_GEM_VERSION
4646

47-
- name: setup-aws-credentials
48-
uses: aws-actions/configure-aws-credentials@v1
47+
- name: dispatch "infrastructure-lambda-api"
48+
uses: peter-evans/repository-dispatch@v1
4949
with:
50-
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
51-
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
52-
aws-region: us-east-1
53-
54-
- name: ecr-login
55-
id: login-ecr
56-
uses: aws-actions/amazon-ecr-login@v1
57-
58-
- name: push to ecr
59-
env:
60-
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
61-
working-directory: .github/lambda
62-
run: |
63-
docker build -t $ECR_REGISTRY/interscript-api:${{env.RELEASE_TAG_NAME}} .
64-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{env.RELEASE_TAG_NAME}}
50+
token: ${{ env.GITHUB_PUSH_TOKEN }}
51+
repository: interscript/infrastructure-lambda-api
52+
event-type: ${{ github.repository }}
53+
client-payload: >-
54+
{
55+
"workflow": "publish-ecr.yml",
56+
"api_tag_name": "${{env.RELEASE_TAG_NAME}}"
57+
}
58+
59+
# - name: setup-aws-credentials
60+
# uses: aws-actions/configure-aws-credentials@v1
61+
# with:
62+
# aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
63+
# aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
64+
# aws-region: us-east-1
65+
#
66+
# - name: ecr-login
67+
# id: login-ecr
68+
# uses: aws-actions/amazon-ecr-login@v1
69+
#
70+
# - name: push to ecr
71+
# env:
72+
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
73+
# working-directory: .github/lambda
74+
# run: |
75+
# docker build -t $ECR_REGISTRY/interscript-api:${{env.RELEASE_TAG_NAME}} .
76+
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{env.RELEASE_TAG_NAME}}
6577

6678

6779

‎lib/interscript-api/graphql/types/query_type.rb‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ def transliterate(system_code:, input:)
5555
end
5656

5757
def detect(input:, output:, map_pattern: "*")
58-
puts "123 before call Interscript.detect"
59-
6058
rs = Interscript.detect(
6159
input,
6260
output,
@@ -68,8 +66,6 @@ def detect(input:, output:, map_pattern: "*")
6866
{ map_name: map_name, distance: distance }
6967
end
7068

71-
puts "123 after call Interscript.detect"
72-
7369
rs
7470
end
7571

‎lib/interscript-api/lambda_function.rb‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ def handler(event:, context: {})
2525
}
2626
end
2727

28-
puts "123 hardcode rababa for testing"
29-
ENV['RABABA_DATA']='/tmp'
30-
3128
query = begin
3229
JSON.parse(body)["query"]
3330
rescue JSON::ParserError
@@ -53,7 +50,6 @@ def handler(event:, context: {})
5350
#ignore
5451
end
5552

56-
puts "123 1"
5753
{
5854
statusCode: status_code,
5955
headers: headers,

0 commit comments

Comments
 (0)