-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (48 loc) · 1.36 KB
/
merge.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
name: 🚀
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: ['main']
env: ${{ secrets }}
jobs:
only-changed:
runs-on: ubuntu-latest
outputs:
projects: ${{ steps.diff.outputs.result }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Find projects which have changed
uses: ./.github/actions/diff
id: diff
with:
only-deployed: true
build-and-deploy:
runs-on: ubuntu-latest
needs: only-changed
# should have at least one project to run (cannot have empty matrix)
if: fromJSON(needs.only-changed.outputs.projects)[0] != null
strategy:
matrix:
project: ${{ fromJSON(needs.only-changed.outputs.projects) }}
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare repository
uses: ./.github/actions/prepare
with:
project: ${{ matrix.project }}
- name: Run tests
working-directory: ${{ matrix.project }}
run: npm run test --if-present
- name: Try build
working-directory: ${{ matrix.project }}
run: npm run build --if-present
- name: Deploy
working-directory: ${{ matrix.project }}
run: npm run deploy --if-present