Skip to content

OPHLUDOS-203-5: Upload to ECR only after image has been built and tested #40

OPHLUDOS-203-5: Upload to ECR only after image has been built and tested

OPHLUDOS-203-5: Upload to ECR only after image has been built and tested #40

Workflow file for this run

name: Build
on:
push:
branches:
- main
concurrency: build-${{ github.ref }}
env:
DOCKER_BUILDKIT: '1' # BuildKit is enabled by default starting in Docker v23, Ubuntu 22.04 has an older version
defaults:
run:
shell: bash
jobs:
build:
permissions:
packages: write
name: 01-build.sh
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run 01-build.sh
run: ./deploy-scripts/01-build.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
server_tests:
permissions:
id-token: write
contents: read
name: 02-run-server-tests.sh
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- name: Configure untuva AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::782034763554:role/ludos-github-actions-role-untuva
aws-region: eu-west-1
- name: Run 02-run-server-tests.sh
run: ./deploy-scripts/02-run-server-tests.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
playwright_tests:
permissions:
id-token: write
contents: read
needs: ['build']
name: 03-run-playwright-tests.sh
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- name: Configure untuva AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::782034763554:role/ludos-github-actions-role-untuva
aws-region: eu-west-1
- name: Run 03-run-playwright-tests.sh
run: ./deploy-scripts/03-run-playwright-tests.sh
env:
LUDOS_PALVELUKAYTTAJA_USERNAME: ${{ secrets.LUDOS_PALVELUKAYTTAJA_USERNAME }}
LUDOS_PALVELUKAYTTAJA_PASSWORD: ${{ secrets.LUDOS_PALVELUKAYTTAJA_PASSWORD }}
lint:
name: 04-lint.sh
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- name: Run 04-lint.sh
run: ./deploy-scripts/04-lint.sh
deploy:
name: '05-deploy.sh'
needs: [lint, build, server_tests, playwright_tests]
permissions:
packages: read
id-token: write
runs-on: "ubuntu-22.04"
steps:
- name: Fetch history for all branches and tags
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deploy
uses: ./.github/actions/deploy
with:
env: 'dev'
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}