-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (34 loc) · 1.17 KB
/
pr-service.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
name: Pull Request Service
on:
pull_request:
paths:
- "services/**"
jobs:
get-diff-workspace:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Check Out The Repository
uses: actions/checkout@v3
with:
fetch-depth: '2'
token: ${{ secrets.GHP_TOKEN }}
- name: diff-workspace
id: set-matrix
run: echo "::set-output name=matrix::{\"workspaces\":[$(yarn changed list --git-range $(git rev-parse HEAD^) --json --exclude xquare-frontend --exclude @shared/xbridge --exclude @shared/xdesign | tr "\n" ",")]}"
build:
runs-on: ubuntu-latest
needs: get-diff-workspace
strategy:
matrix: ${{ fromJson(needs.get-diff-workspace.outputs.matrix) }}
steps:
- name: Check Out The Repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GHP_TOKEN }}
- name: Get Service
id: get_service
run: echo ::set-output name=SERVICE::$(echo ${{ matrix.workspaces.name }} | cut -d / -f 2)
- name: Docker Build
run: yarn docker build @service/${{steps.get_service.outputs.SERVICE}}