Skip to content

bugfix: fix RiskAnalysisTemplateAnswer component in the BFF api (PI… #1654

bugfix: fix RiskAnalysisTemplateAnswer component in the BFF api (PI…

bugfix: fix RiskAnalysisTemplateAnswer component in the BFF api (PI… #1654

Workflow file for this run

name: "Build & Push"
on:
push:
branches:
- "develop"
tags:
- "*"
paths:
- "packages/**"
- "!packages/*/scripts/**"
- ".github/workflows/build-push.yaml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
find_dockerfiles:
name: Find Dockerfiles
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.set_packages_output.outputs.packages }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Find packages
id: set_packages_output
run: |
PACKAGES=$(find packages -type f -path "*/Dockerfile" | awk -F'/' '{print $2}' | jq -R -s -c 'split("\n")[:-1]')
echo "packages=$PACKAGES" >> $GITHUB_OUTPUT
build_push_image:
name: ${{ matrix.package }}
needs: [find_dockerfiles]
runs-on: ["codebuild-pagopa-interop-be-monorepo-github-runners-dev-${{ github.run_id }}-${{ github.run_attempt }}"]
environment: ecr
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.find_dockerfiles.outputs.packages) }}
env:
DOCKER_BUILD_SUMMARY: "false"
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2
- name: Normalize ref name
id: norm_ref
run: |
set -euo pipefail
NORM_REF="$(echo ${{ github.ref_name }} | sed -e 's/\//-/g')"
echo "NORM_REF=$NORM_REF" >> $GITHUB_ENV
- name: (branch) Docker metadata
id: meta_branch
if: ${{ github.ref_type == 'branch' }}
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f
with:
images: ${{ steps.login-ecr.outputs.registry }}/interop-be-${{ matrix.package }}
flavor: |
latest=false
prefix=
suffix=
tags: |
type=raw,value=${{ env.NORM_REF }}
- name: (tag) Docker metadata
id: meta_tag
if: ${{ github.ref_type == 'tag' }}
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f
with:
images: ${{ steps.login-ecr.outputs.registry }}/interop-be-${{ matrix.package }}
flavor: |
latest=false
prefix=
suffix=
tags: |
type=ref,event=tag
- name: Build and push Docker image
id: build_push
uses: docker/build-push-action@55146d969b0dff1a5c12630229609757af5b1081
with:
context: .
file: packages/${{ matrix.package }}/Dockerfile
build-args: |
NODE_REGISTRY=${{ vars.NODE_REGISTRY }}
push: true
tags: ${{ github.ref_type == 'branch' && steps.meta_branch.outputs.tags || steps.meta_tag.outputs.tags }}
labels: ${{ github.ref_type == 'branch' && steps.meta_branch.outputs.labels || steps.meta_tag.outputs.labels }}