-
Notifications
You must be signed in to change notification settings - Fork 1
104 lines (92 loc) · 2.83 KB
/
main-v3.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
name: Build, push, and deploy
on: [push]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v1
with:
registry-url: https://npm.pkg.github.com
scope: '@navikt'
- name: Install lint dependencies
run: bun install
env:
BUN_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Run lint
run: bun run lint
- name: Install dependencies (bun)
working-directory: './packages/internarbeidsflate-decorator-v3'
run: bun install
env:
BUN_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Run tests
working-directory: './packages/internarbeidsflate-decorator-v3'
run: bun run test
- name: Build application
working-directory: './packages/internarbeidsflate-decorator-v3'
run: bun run build
- name: Upload build
uses: actions/upload-artifact@v4
if: github.ref == 'refs/heads/master'
with:
name: app-dist
path: packages/internarbeidsflate-decorator-v3/dist
deploy-dev:
name: Deploy to dev
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
environment: dev-cdn
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/download-artifact@v4
with:
name: app-dist
path: dist
- name: Upload to CDN dev path
uses: nais/deploy/actions/cdn-upload/v2@master
with:
team: personoversikt
source: dist
destination: /internarbeidsflate-decorator-v3/dev/latest
cache_invalidation: true
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
headers: |-
cache-control: public, max-age=300
deploy-prod:
name: Deploy to prod
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
environment: prod-cdn
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/download-artifact@v4
with:
name: app-dist
path: dist
- name: Upload to CDN prod path
uses: nais/deploy/actions/cdn-upload/v2@master
with:
team: personoversikt
source: dist
destination: /internarbeidsflate-decorator-v3/prod/latest
cache_invalidation: true
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
headers: |-
cache-control: public, max-age=600