Skip to content

Merge pull request #224 from codeforjapan/fix/helpfulness-level-nullable #136

Merge pull request #224 from codeforjapan/fix/helpfulness-level-nullable

Merge pull request #224 from codeforjapan/fix/helpfulness-level-nullable #136

name: Deploy ETL Lambda (dev)
on:
pull_request:
branches: [ main ]
paths:
- 'etl/**'
- 'common/**'
- 'migrate/**'
- '.github/workflows/deploy-etl-lambda.yml'
push:
branches: [ main ]
paths:
- 'etl/**'
- 'common/**'
- 'migrate/**'
- '.github/workflows/deploy-etl-lambda.yml'
permissions:
id-token: write
contents: read
actions: write
jobs:
build-and-push:
runs-on: ubuntu-latest
outputs:
image-tag: ${{ steps.tag.outputs.tag }}
strategy:
matrix:
lambda:
- { dockerfile: Dockerfile.extract, repository: birdxplorer-etl }
- { dockerfile: Dockerfile.language_detect, repository: birdxplorer-etl-lang }
- { dockerfile: Dockerfile.note_transform, repository: birdxplorer-etl-note-transform }
- { dockerfile: Dockerfile.topic_detect, repository: birdxplorer-etl-topic }
- { dockerfile: Dockerfile.postlookup, repository: birdxplorer-etl-postlookup }
- { dockerfile: Dockerfile.db_writer, repository: birdxplorer-etl-db-writer }
- { dockerfile: Dockerfile.note_status_update, repository: birdxplorer-etl-note-status-update }
- { dockerfile: Dockerfile.post_transform, repository: birdxplorer-etl-post-transform }
steps:
- uses: actions/checkout@v5
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ap-northeast-1
- uses: aws-actions/amazon-ecr-login@v2
id: login-ecr
- uses: docker/setup-buildx-action@v3
- id: tag
run: |
sha=$(echo "${{ github.sha }}" | cut -c1-7)
echo "tag=dev-sha$sha" >> $GITHUB_OUTPUT
- uses: docker/build-push-action@v5
with:
context: ./
file: ./etl/${{ matrix.lambda.dockerfile }}
push: true
tags: |
${{ steps.login-ecr.outputs.registry }}/${{ matrix.lambda.repository }}:${{ steps.tag.outputs.tag }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
deploy-cdk:
needs: build-and-push
uses: ./.github/workflows/_deploy.yaml
with:
deploy-env: dev
image-tag: ${{ needs.build-and-push.outputs.image-tag }}
verify-images: >
birdxplorer-etl,
birdxplorer-etl-lang,
birdxplorer-etl-note-transform,
birdxplorer-etl-topic,
birdxplorer-etl-postlookup,
birdxplorer-etl-db-writer,
birdxplorer-etl-note-status-update,
birdxplorer-etl-post-transform
stacks: "devbird-xplorerStack"
secrets: inherit