Skip to content

Merge pull request #739 from digabi/feature/node22 #37

Merge pull request #739 from digabi/feature/node22

Merge pull request #739 from digabi/feature/node22 #37

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Deploy Test
on:
push:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Increase file watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npx playwright install
- run: npm run build:internet
- run: npm run test
env:
CI: true
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: arn:aws:iam::${{ secrets.TEST_ACCOUNT_ID }}:role/GithubActionsAccessRole
aws-region: eu-north-1
- name: Move release files into release dir
run: |
mkdir -p release
cp -r common release/
cp -r build release/
cp -r index.html accessibility-fi.html accessibility-sv.html release/
- name: Sync release files into the test bucket
run: aws s3 sync release/ s3://${{ secrets.TEST_DEPLOY_BUCKET_NAME }}
- name: Invalidate Cloudfront
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.TEST_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"