Ok 580 muut #468
Workflow file for this run
This file contains 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: Valintojen toteuttaminen workflow | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
HUSKY: 0 | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
lint-and-test: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-next-env | |
- name: Check types | |
run: npm run typecheck | |
- name: Run linter | |
run: npm run lint | |
- name: Run unit tests | |
run: npm run test | |
e2e: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
browser: [chromium, firefox, webkit] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-next-env | |
- name: Create self-signed dev certificates | |
run: npm run create-self-signed-dev-certs | |
- name: Build app | |
run: npm run build-test | |
- name: Run Playwright tests | |
env: | |
PLAYWRIGHT_ARGS: --project=${{ matrix.browser }} | |
run: npm run start-and-test-playwright-docker | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 10 | |
if-no-files-found: ignore | |
deploy-zip: | |
needs: [lint-and-test, e2e] | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-next-env | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }} | |
role-session-name: valintojen-toteuttaminen-deploy-zip | |
aws-region: eu-west-1 | |
- name: Deploy zip to s3 | |
env: | |
bucket: ${{ secrets.BUCKET_NAME }} | |
run: | | |
npm run build | |
zip -r ga-${{github.run_number}}.zip .next/*.* .next/BUILD_ID .next/static .next/standalone public | |
aws s3 cp --no-progress ga-${{github.run_number}}.zip s3://"$bucket"/ga-${{github.run_number}}.zip |