-
Notifications
You must be signed in to change notification settings - Fork 3
77 lines (73 loc) · 2.42 KB
/
next-deployment.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
name: Next Deployment
concurrency: next_environment
on:
push:
branches:
- main
jobs:
deployment:
runs-on: ubuntu-latest
environment:
name: Next
url: ${{ steps.spa-deployment.outputs.url }}
outputs:
spaUrl: ${{ steps.spa-deployment.outputs.url }}
permissions:
contents: read
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci --ignore-scripts
- name: Build and Deploy API
id: api-deployment
uses: ./.github/actions/build-and-deploy-api
with:
deploymentEnv: "next"
releaseVersion: ${{ github.sha }}
sentryAuthToken: ${{ secrets.SENTRY_AUTH_TOKEN }}
containerRegistryUrl: ghcr.io
containerRegistryUsername: ${{ github.actor }}
containerRegistryPassword: ${{ secrets.GITHUB_TOKEN }}
containerTag: ghcr.io/kordis-leitstelle/kordis-api:${{ github.sha }}
- name: Apply Database Migrations
run: echo "add again once infrastructure is set up" # ./tools/db/kordis-db.sh apply-pending-migrations
env:
MONGODB_URI: ${{ secrets.DEV_MONGODB_URI }}
MONGODB_DB: dev
- name: Build and Deploy SPA
id: spa-deployment
uses: ./.github/actions/build-and-deploy-spa
with:
releaseVersion: ${{ github.sha }}
deploymentEnv: "next"
sentryAuthToken: ${{ secrets.SENTRY_AUTH_TOKEN }}
containerRegistryUrl: ghcr.io
containerRegistryUsername: ${{ github.actor }}
containerRegistryPassword: ${{ secrets.GITHUB_TOKEN }}
containerTag: ghcr.io/kordis-leitstelle/kordis-spa:${{ github.sha }}
e2e:
needs: deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- name: Run SPA E2Es
run: echo "add again when deployment is ready" # npx nx e2e spa-e2e
env:
E2E_BASE_URL: ${{ needs.deployment.outputs.spaUrl }}
AADB2C_TEST_USERS: ${{ secrets.E2E_TEST_USERS }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: e2e-test-results
path: test-results/
if-no-files-found: ignore