-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (53 loc) · 1.75 KB
/
build.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
name: Build workflow-testing
on:
push:
branches:
- "**"
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
schedule:
- cron: '*/5 * * * *'
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
trigger:
# store trigger reason
runs-on: ubuntu-latest
outputs:
is_release: ${{ steps.reason.outputs.is_release }}
is_push_on_default_branch: ${{ steps.reason.outputs.is_push_on_default_branch }}
is_schedule: ${{ steps.reason.outputs.is_schedule }}
steps:
- id: reason
run: |
echo "is_release=${{ startsWith(github.ref, 'refs/tags/v') }}" >> $GITHUB_OUTPUT
echo "is_push_on_default_branch=${{ (github.event_name == 'push') && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch)) }}" >> $GITHUB_OUTPUT
echo "is_schedule="${{ github.event_name == 'schedule' }} >> $GITHUB_OUTPUT
display-trigger:
needs: trigger
runs-on: ubuntu-latest
steps:
- run: |
echo is_release=${{ needs.trigger.is_release }}
echo is_push_on_default_branch=${{ needs.trigger.is_push_on_default_branch }}
echo is_schedule=${{ needs.trigger.is_schedule }}
only-on-master:
needs: [trigger]
runs-on: ubuntu-latest
if: needs.trigger.outputs.is_push_on_default_branch == 'true'
outputs:
notebooks-branch: ${{ steps.write-output.outputs.notebooks_branch }}
steps:
- id: write-output
run: |
echo "yo"
echo "notebooks_branch=toto" >> $GITHUB_OUTPUT
on-all-branches:
needs: only-on-master
runs-on: ubuntu-latest
if: always()
steps:
- run: echo yo ${{ needs.only-on-master.outputs.notebooks-branch }}