-
Notifications
You must be signed in to change notification settings - Fork 4
99 lines (85 loc) · 2.82 KB
/
action_main.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
name: MAIN
on:
push:
tags:
- grader-service-*
- grader-convert-*
- grader-labextension-*
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
init:
runs-on: ubuntu-latest
outputs:
changeDirs: ${{ steps.outputStep.outputs.changeDirs }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get changed dirs # To check if any files changed in a directory
id: changeDirsStep
uses: tj-actions/[email protected]
with:
dir_names: true
files: |
**/*
- id: outputStep
run: echo "::set-output name=changeDirs::${{ steps.changeDirsStep.outputs.all_changed_files }}"
# ON CHANGED FILES
build_grader-service:
uses: ./.github/workflows/build_service.yml
needs: init
if: contains(needs.init.outputs.changeDirs, 'grader_service')
dockerize_grader-service:
needs: build_grader-service
uses: ./.github/workflows/docker_service.yml
build_labextension:
uses: ./.github/workflows/build_labextension.yml
needs: init
if: contains(needs.init.outputs.changeDirs, 'grader_labextension')
dockerize_labextension:
needs: build_labextension
uses: ./.github/workflows/docker_labextension.yml
secrets: inherit
build_convert:
needs: init
if: contains(needs.init.outputs.changeDirs, 'grader_convert')
uses: ./.github/workflows/build_convert.yml
release_helm:
needs: init
if: contains(needs.init.outputs.changeDirs, 'charts/grader-service') && startsWith(github.ref, 'refs/tags/grader-service') && !startsWith(github.ref, 'refs/tags/grader-service-helm')
uses: ./.github/workflows/publish_helm.yml
secrets: inherit
# docs:
# runs-on: ubuntu-latest
# steps:
# - uses: ./.github/workflows/reusable/build_docs
# ONLY ON MERGE SUCCEED
pre-release:
runs-on: ubuntu-latest
needs:
- dockerize_grader-service
- dockerize_labextension
- build_convert
if: always() && github.event.pull_request.merged == true && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure'))
steps:
- name: TODO use correct version tags for pre-release
run: echo 'TODO use correct version tags for pre-release'
# ONLY ON TAGS
release_grader-service:
needs: dockerize_grader-service
if: startsWith(github.ref, 'refs/tags/grader-service')
uses: ./.github/workflows/publish_service.yml
secrets: inherit
release_labextension:
needs: build_labextension
if: startsWith(github.ref, 'refs/tags/grader-labextension')
uses: ./.github/workflows/publish_labextension.yml
secrets: inherit
release_convert:
needs: build_convert
if: startsWith(github.ref, 'refs/tags/grader-convert')
uses: ./.github/workflows/publish_convert.yml
secrets: inherit