Skip to content

Päivitetty Spring Boot #1364

Päivitetty Spring Boot

Päivitetty Spring Boot #1364

Workflow file for this run

name: Kouta-ui
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HUSKY: 0
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'corretto'
cache: 'maven'
- uses: szenius/set-timezone@v1.1
with:
timezoneLinux: "Europe/Helsinki"
- name: Build with Maven
run: |
git clone https://github.com/Opetushallitus/ci-tools.git
source ci-tools/common/setup-tools.sh
mvn clean package -B
- uses: actions/cache@v3
id: restore-build
with:
path: target
key: ${{ github.sha }}
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/main/app
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: 'src/main/app/.nvmrc'
cache: 'npm'
cache-dependency-path: src/main/app/package-lock.json
- name: Install dependencies
run: |
npm ci --no-audit --prefer-offline
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- run: npx playwright install --with-deps chromium
if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: Run tests
run: |
npm run lint
npm run test:ci
publish-storybook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: 'src/main/app/.nvmrc'
cache: 'npm'
cache-dependency-path: src/main/app/package-lock.json
- name: Build and publish storybook
run: |
git clone https://github.com/Opetushallitus/ci-tools.git
source ci-tools/common/setup-tools.sh
sh scripts/publish-storybook.sh
deploy-container:
needs: [build, test, publish-storybook]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: restore-build
with:
path: target
key: ${{ github.sha }}
- name: Build Docker container
shell: bash
run: |
git clone https://github.com/Opetushallitus/ci-tools.git
source ci-tools/common/setup-tools.sh
export ARTIFACT_NAME="kouta-ui"
mv target/kouta-ui-*.jar $DOCKER_BUILD_DIR/artifact/${ARTIFACT_NAME}.jar
cp -vr src/main/resources/* $DOCKER_BUILD_DIR/config/
export BASE_IMAGE="baseimage-fatjar-openjdk21:master"
./ci-tools/common/pull-image.sh
./ci-tools/github-build/build-fatjar.sh $ARTIFACT_NAME
./ci-tools/github-build/upload-image.sh $ARTIFACT_NAME