forked from podkrepi-bg/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (92 loc) · 2.94 KB
/
tests.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
name: Tests
on:
workflow_call:
secrets:
SENTRY_AUTH_TOKEN:
required: true
GHOST_CONTENT_KEY:
required: true
MONDOO_SECRET:
required: true
STRIPE_WEBHOOK_SECRET:
required: true
STRIPE_SECRET_KEY:
required: true
jobs:
build-frontend:
name: Build and scan frontend container image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Build
uses: docker/build-push-action@v6
env:
NODE_ENV: production
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
GHOST_API_URL: https://blog.podkrepi.bg
GHOST_CONTENT_KEY: ${{ secrets.GHOST_CONTENT_KEY }}
with:
context: .
push: false
target: runner
build-args: |
SENTRY_AUTH_TOKEN=${{ env.SENTRY_AUTH_TOKEN }}
GHOST_API_URL=${{ env.GHOST_API_URL }}
GHOST_CONTENT_KEY=${{ env.GHOST_CONTENT_KEY }}
tags: ghcr.io/podkrepi-bg/frontend:pr
- name: Scan with Mondoo
uses: mondoohq/actions/docker-image@main
env:
MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }}
with:
image: ghcr.io/podkrepi-bg/frontend:pr
build-maintenance:
name: Build and scan maintenance container image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Build
uses: docker/build-push-action@v6
with:
push: false
file: Dockerfile.maintenance
tags: ghcr.io/podkrepi-bg/maintenance:pr
- name: Scan with Mondoo
uses: mondoohq/actions/docker-image@main
env:
MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }}
with:
image: ghcr.io/podkrepi-bg/maintenance:pr
scan-manifests:
name: Scan k8s manifests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install kustomize
uses: imranismail/setup-kustomize@v2
- name: Build development manifests
run: kustomize build manifests/overlays/development > dev-manifests.yaml
- name: Scan development manifests with Mondoo
uses: mondoohq/actions/k8s-manifest@main
env:
MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }}
with:
path: dev-manifests.yaml
- name: Build production manifests
run: kustomize build manifests/overlays/production > prod-manifests.yaml
- name: Scan production manifests with Mondoo
uses: mondoohq/actions/k8s-manifest@main
env:
MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }}
with:
path: prod-manifests.yaml
run-playwright:
name: Run Playwright
uses: ./.github/workflows/playwright.yml
secrets: inherit