-
Notifications
You must be signed in to change notification settings - Fork 1
132 lines (122 loc) · 3.82 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Build
on:
push:
branches:
- main
workflow_call:
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-24.04
steps:
- uses: actions/[email protected]
- name: Send build status "in progress"
if: github.ref == 'refs/heads/main'
uses: ./.github/actions/build_status
with:
task: build-image
status: inProgress
api_key: ${{ secrets.RADIATOR_AUTH_TOKEN }}
- 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-24.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-24.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-24.04
steps:
- uses: actions/[email protected]
- name: Run 04-lint.sh
run: ./deploy-scripts/04-lint.sh
frontend_unit_tests:
name: 06-run-frontend-unittests.sh
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- name: Run 06-run-frontend-unittests.sh
run: ./deploy-scripts/06-run-frontend-unittests.sh
push_image:
name: 05-push-image.sh
if: github.ref == 'refs/heads/main'
needs: [lint, build, server_tests, playwright_tests, frontend_unit_tests]
permissions:
packages: read
id-token: write
runs-on: 'ubuntu-24.04'
steps:
- name: Fetch history for all branches and tags
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push image
uses: ./.github/actions/push_image
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
build_status_completed:
name: Send build status
needs: [push_image]
if: ${{ always() && github.ref == 'refs/heads/main' }}
continue-on-error: true
runs-on: 'ubuntu-24.04'
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/build_status
with:
task: build-image
status: ${{ needs.push_image.result == 'success' && 'success' || 'failure' }}
api_key: ${{ secrets.RADIATOR_AUTH_TOKEN }}
deploy_untuva:
needs: [push_image]
uses: ./.github/workflows/deploy_untuva.yml
secrets: inherit