Merge pull request #208 from codeforjapan/feat/add-skip-logic #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release to Production | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| actions: write | ||
| concurrency: | ||
| group: cdk-prd | ||
| cancel-in-progress: false | ||
| jobs: | ||
| release: | ||
|
Check failure on line 18 in .github/workflows/release-prd.yml
|
||
| uses: ./.github/workflows/_release.yaml | ||
| secrets: inherit | ||
| build-push-api: | ||
| needs: release | ||
| if: needs.release.outputs.created == 'true' | ||
| runs-on: ubuntu-latest | ||
| 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 | ||
| - uses: docker/build-push-action@v5 | ||
| with: | ||
| context: ./api | ||
| file: ./api/Dockerfile.prd | ||
| push: true | ||
| tags: | | ||
| ${{ steps.login-ecr.outputs.registry }}/birdxplorer-api:${{ needs.release.outputs.tag_name }} | ||
| platforms: linux/amd64 | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| provenance: false | ||
| build-push-etl: | ||
| needs: release | ||
| if: needs.release.outputs.created == 'true' | ||
| runs-on: ubuntu-latest | ||
| 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 | ||
| - uses: docker/build-push-action@v5 | ||
| with: | ||
| context: ./ | ||
| file: ./etl/${{ matrix.lambda.dockerfile }} | ||
| push: true | ||
| tags: | | ||
| ${{ steps.login-ecr.outputs.registry }}/${{ matrix.lambda.repository }}:${{ needs.release.outputs.tag_name }} | ||
| platforms: linux/amd64 | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| provenance: false | ||
| deploy-cdk-prd: | ||
| needs: [release, build-push-api, build-push-etl] | ||
| if: needs.release.outputs.created == 'true' | ||
| uses: ./.github/workflows/_deploy.yaml | ||
| with: | ||
| deploy-env: prd | ||
| image-tag: ${{ needs.release.outputs.tag_name }} | ||
| verify-images: > | ||
| birdxplorer-api, | ||
| 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: "prdbird-xplorerStack prdbird-xplorerApiStack" | ||
| secrets: inherit | ||