-
Notifications
You must be signed in to change notification settings - Fork 2
110 lines (104 loc) · 4.06 KB
/
mr-admin-flate.yaml
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
name: CI/CD (mr-admin-flate)
on:
push:
paths:
- .github/workflows/mr-admin-flate.yaml
- package.json
- package-lock.json
- turbo.json
- frontend/mr-admin-flate/**
- mulighetsrommet-api/src/main/resources/web/openapi.yaml
workflow_dispatch:
inputs:
environment:
type: choice
description: Environment
required: true
default: dev
options:
- dev
- dev_and_prod
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CI: true
TZ: Europe/Amsterdam
jobs:
ci:
name: CI
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.41.1-jammy
steps:
- uses: actions/checkout@v4
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Test
run: npx turbo run lint test:ci playwright --filter=mr-admin-flate
deploy-dev:
name: Deploy (dev)
runs-on: ubuntu-latest
needs: [ci]
permissions:
id-token: "write" # Used to authenticate with Google Cloud
if: github.event_name == 'push' && github.ref_name == 'main' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Build
run: npx turbo run build --filter=mr-admin-flate
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/932652929200/locations/global/workloadIdentityPools/github/providers/github-action
service_account: [email protected]
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
- name: Upload files to GCS
run: gsutil -m rsync -r /home/runner/work/mulighetsrommet/mulighetsrommet/frontend/mr-admin-flate/dist gs://mr-admin-flate-dev
deploy-demo:
name: Deploy (demo)
runs-on: ubuntu-latest
needs: [ci]
permissions:
id-token: "write" # Used to authenticate with Google Cloud
if: github.event_name == 'push' && github.ref_name == 'main' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Build
run: npx turbo run build:demo --filter=mr-admin-flate
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/932652929200/locations/global/workloadIdentityPools/github/providers/github-action
service_account: [email protected]
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
- name: Upload files to GCS
run: gsutil -m rsync -r /home/runner/work/mulighetsrommet/mulighetsrommet/frontend/mr-admin-flate/dist gs://mr-admin-flate-demo
deploy-prod:
name: Deploy (prod)
runs-on: ubuntu-latest
needs: [ci, deploy-dev, deploy-demo]
permissions:
id-token: "write" # Used to authenticate with Google Cloud
if: github.event_name == 'push' && github.ref_name == 'main' || github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'dev_and_prod'
steps:
- uses: actions/checkout@v4
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Build
run: npx turbo run build --filter=mr-admin-flate
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/380520190028/locations/global/workloadIdentityPools/github/providers/github-action
service_account: prod-deploy@team-mulighetsrommet-prod-5492.iam.gserviceaccount.com
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
- name: Upload files to GCS
run: gsutil -m rsync -r /home/runner/work/mulighetsrommet/mulighetsrommet/frontend/mr-admin-flate/dist gs://mr-admin-flate-prod