generated from int128/typescript-actions-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 7
80 lines (75 loc) · 2.17 KB
/
environment-matrix.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
name: environment-matrix
on:
pull_request:
paths:
- environment-matrix/**
- '*.json'
- '*.yaml'
- .github/workflows/environment-matrix.yaml
push:
branches:
- main
paths:
- environment-matrix/**
- '*.json'
- '*.yaml'
- .github/workflows/environment-matrix.yaml
defaults:
run:
working-directory: environment-matrix
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
- run: corepack enable pnpm
- run: pnpm i
- run: pnpm test
e2e-test:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
environments: ${{ steps.environment-matrix.outputs.json }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
- run: corepack enable pnpm
- run: pnpm i
- run: pnpm build
- uses: ./environment-matrix
id: environment-matrix
with:
service: example
rules: |
- pull_request:
base: '**'
head: '**'
environments:
- overlay: pr
namespace: pr-${{ github.event.pull_request.number }}
- push:
ref: refs/heads/main
environments:
- overlay: development
namespace: development
e2e-test-matrix:
needs: e2e-test
runs-on: ubuntu-latest
timeout-minutes: 3
defaults:
run:
working-directory: . # run without actions/checkout
strategy:
fail-fast: true
matrix:
environment: ${{ fromJSON(needs.e2e-test.outputs.environments) }}
steps:
- run: echo 'overlay=${{ matrix.environment.overlay }}'
- run: echo 'namespace=${{ matrix.environment.namespace }}'
- run: echo 'github-deployment-url=${{ matrix.environment.github-deployment-url }}'