-
Notifications
You must be signed in to change notification settings - Fork 8
147 lines (134 loc) · 4.59 KB
/
example-apps-ci.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Build Example Apps
on:
pull_request:
types: [opened, synchronize, reopened, "ready_for_review"]
push:
branches:
- main
concurrency:
group: CI-Example-Apps-${{ github.ref }}
cancel-in-progress: true
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
jobs:
build-example-apps:
strategy:
matrix:
include:
- node-version: 20
example-app: wc-angular12
- node-version: 16
example-app: wc-next10
- node-version: 20
example-app: wc-next13
- node-version: 16
example-app: wc-nuxt2
- node-version: 20
example-app: wc-nuxt3
- node-version: 20
example-app: wc-react17
- node-version: 20
example-app: wc-react18
- node-version: 20
example-app: wc-vanilla
- node-version: 20
example-app: wc-vue3
name: Build ${{matrix.example-app}} - Node ${{ matrix.node-version }}
uses: ./.github/workflows/install-build.yml
with:
os: ubuntu-latest
node-version: ${{ matrix.node-version }}
build-script: build:examples --filter=${{ matrix.example-app }}
secrets: inherit
lint-example-apps:
strategy:
matrix:
include:
- node-version: 16
example-app: wc-next10
os: ubuntu-latest
- node-version: 20
example-app: wc-next13
os: ubuntu-latest
needs: build-example-apps
name: Lint ${{ matrix.example-app }}
runs-on: ${{ matrix.os }}
steps:
# Checkout the Repo
- name: Checkout
uses: actions/checkout@v3
# Setup Repo
- name: Setup Repo
uses: ./.github/actions/setup-repo
with:
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
# Linting
- name: Linting
uses: ./.github/actions/run-script
with:
script-name: "lint:examples --filter=${{ matrix.example-app }}"
deploy-example-apps:
needs: lint-example-apps
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
strategy:
matrix:
include:
- node-version: 20
amplify-app-id: d3krjop5uu4oza
build-script: build:examples
dist-folder: ./apps/examples/wc-angular12/dist/wc-angular12
example-app: wc-angular12
- node-version: 16
amplify-app-id: d2po5gzj2z57w1
build-script: build:examples
dist-folder: ./apps/examples/wc-next10/build
example-app: wc-next10
- node-version: 20
amplify-app-id: d3g23senqajlhy
build-script: build:examples
dist-folder: ./apps/examples/wc-next13/build
example-app: wc-next13
# Using the generate:examples script for static hosting. SSR requires more investigation
- node-version: 16
amplify-app-id: d3puta7o12ynlf
build-script: generate:examples
dist-folder: ./apps/examples/wc-nuxt2/dist
example-app: wc-nuxt2
# Using the generate:examples script for static hosting. SSR requires more investigation
- node-version: 20
amplify-app-id: d1mfepkt71qwu0
build-script: generate:examples
dist-folder: ./apps/examples/wc-nuxt3/dist
example-app: wc-nuxt3
- node-version: 20
amplify-app-id: d2a3kuvjs3esad
build-script: build:examples
dist-folder: ./apps/examples/wc-react17/build
example-app: wc-react17
- node-version: 20
amplify-app-id: d1zlc7g0rtfm9g
build-script: build:examples
dist-folder: ./apps/examples/wc-react18/build
example-app: wc-react18
- node-version: 20
amplify-app-id: d1vykunmq1k4jp
build-script: build:examples
dist-folder: ./apps/examples/wc-vanilla/dist
example-app: wc-vanilla
- node-version: 20
amplify-app-id: dtgmklfymp81v
build-script: build:examples
dist-folder: ./apps/examples/wc-vue3/dist
example-app: wc-vue3
name: Deploy ${{matrix.example-app}}
uses: ./.github/workflows/amplify-deploy.yml
with:
os: ubuntu-latest
node-version: ${{ matrix.node-version }}
amplify-app-id: ${{ matrix.amplify-app-id }}
package-name: ${{ matrix.example-app}}
package-dist-directory: ${{ matrix.dist-folder }}
bucket-name-main: 'pie-example-apps-main'
build-script: ${{ matrix.build-script }}
secrets: inherit