Skip to content

Update dependencies #855

Update dependencies

Update dependencies #855

Workflow file for this run

name: ci
on:
push:
branches:
- "**"
workflow_dispatch:
inputs:
deploy-to-dev:
description: "Whether to deploy to dev"
type: boolean
required: true
default: false
defaults:
run:
# NOTE: A bit stricter than the default bash options used by GitHub Actions
# (bash --noprofile --norc -e -o pipefail {0})
shell: bash --noprofile --norc -euo pipefail {0}
# NOTE: Set concurrency for the current workflow to 1
concurrency: ci-${{ github.ref }}-${{ github.workflow }}
jobs:
build-and-deploy:
timeout-minutes: 60
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
id-token: write
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: capralifecycle/actions-lib/check-runtime-dependencies@f3dcdbe2cd85725311b4ff5ff8dde9dfaf4f3111 # v1.5.4
- uses: capralifecycle/actions-lib/parse-config@f3dcdbe2cd85725311b4ff5ff8dde9dfaf4f3111 # v1.5.4
id: config
with:
config-file: ".ldp.json"
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 20.9.0
- name: install dependencies
run: npm ci
- name: lint
run: npm run lint
- name: install playwright browsers
run: npx playwright install --with-deps
- name: build
run: npm run build:ci
- name: test
run: npm run test
# - name: test - component
# run: npm run test:component:ci
# - name: test - e2e
# run: npm run test:e2e:ci
- uses: capralifecycle/actions-lib/configure-aws-credentials@f3dcdbe2cd85725311b4ff5ff8dde9dfaf4f3111 # v1.5.4
id: aws
with:
aws-account-id: ${{ steps.config.outputs.accountId }}
# NOTE: We use different roles on default and non-default branches
aws-iam-role-name: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && steps.config.outputs.roleName || steps.config.outputs.limitedRoleName }}
- uses: capralifecycle/actions-lib/upload-s3-artifact@f3dcdbe2cd85725311b4ff5ff8dde9dfaf4f3111 # v1.5.4
if: ${{ github.ref == 'refs/heads/master' || inputs.deploy-to-dev }}
id: upload-s3-artifact
env:
AWS_ACCESS_KEY_ID: ${{ steps.aws.outputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ steps.aws.outputs.aws-secret-access-key }}
AWS_SESSION_TOKEN: ${{ steps.aws.outputs.aws-session-token }}
with:
aws-s3-bucket-name: ${{ steps.config.outputs.artifactBucket }}
target-path: "build"
- name: trigger development deployment pipelines
uses: capralifecycle/actions-lib/trigger-deployment-pipeline@f3dcdbe2cd85725311b4ff5ff8dde9dfaf4f3111 # v1.5.4
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || inputs.deploy-to-dev }}
env:
AWS_ACCESS_KEY_ID: ${{ steps.aws.outputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ steps.aws.outputs.aws-secret-access-key }}
AWS_SESSION_TOKEN: ${{ steps.aws.outputs.aws-session-token }}
with:
pipelines: ${{ steps.config.outputs.devPipelines }}
aws-s3-bucket-name: ${{ steps.config.outputs.artifactBucket }}
trigger-type: "artifact"
# NOTE: The key passed to artifact-parameters will be the name of
# the SSM parameter where the reference to the artifact is stored.
artifact-parameters: "devWebappArtifactS3Key=${{ steps.upload-s3-artifact.outputs.aws-s3-key }}"
- name: trigger production deployment pipelines
uses: capralifecycle/actions-lib/trigger-deployment-pipeline@f3dcdbe2cd85725311b4ff5ff8dde9dfaf4f3111 # v1.5.4
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
env:
AWS_ACCESS_KEY_ID: ${{ steps.aws.outputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ steps.aws.outputs.aws-secret-access-key }}
AWS_SESSION_TOKEN: ${{ steps.aws.outputs.aws-session-token }}
with:
pipelines: ${{ steps.config.outputs.prodPipelines }}
aws-s3-bucket-name: ${{ steps.config.outputs.artifactBucket }}
trigger-type: "artifact"
artifact-parameters: "prodWebappArtifactS3Key=${{ steps.upload-s3-artifact.outputs.aws-s3-key }}"