File tree Expand file tree Collapse file tree 1 file changed +50
-6
lines changed Expand file tree Collapse file tree 1 file changed +50
-6
lines changed Original file line number Diff line number Diff line change 8
8
9
9
- Here is the list of [ GitHub actions events] ( https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows )
10
10
11
- ## 👨🚀 Exercise 1
11
+ ## 👨🚀 Exercise 2. 1
12
12
13
- - [ ] Create a Push Event
13
+ - [ ] Create a ** Push Event**
14
14
15
15
``` yml
16
16
name : CI on Push
@@ -31,16 +31,16 @@ jobs:
31
31
32
32
- [ ] Commit to your repository to launch the action
33
33
34
- ## 👨🚀 Exercise 2
34
+ ## 👨🚀 Exercise 2.2
35
35
36
- - [ ] Create a Pull Request Event
36
+ - [ ] Create a ** Pull Request Event**
37
37
38
38
` ` ` yml
39
39
name : CI on Pull Request
40
40
on :
41
41
pull_request :
42
42
branches :
43
- - master
43
+ - main
44
44
45
45
jobs :
46
46
test :
50
50
uses : actions/checkout@v2
51
51
- name : Run a one-line script
52
52
run : echo Hello, Pull Request Event!
53
- ` ` `
53
+ ` ` `
54
+
55
+ - [ ] Commit to your repository to launch the action
56
+
57
+ ## 👨🚀 Exercise 2.3
58
+
59
+ - [ ] Create a **Schedule Event**
60
+
61
+ ` ` ` yml
62
+ name : Nightly build
63
+ on :
64
+ schedule :
65
+ - cron : ' 0 0 * * *'
66
+
67
+ jobs :
68
+ build :
69
+ runs-on : ubuntu-latest
70
+ steps :
71
+ - name : Checkout code
72
+ uses : actions/checkout@v2
73
+ - name : Run a one-line script
74
+ run : echo Hello, Scheduled Event!
75
+ ` ` `
76
+
77
+ In this example, the workflow runs every day at midnight (UTC).
78
+
79
+ ## 👨🚀 Exercise 2.4
80
+
81
+ - [ ] Create a **Release Event**
82
+
83
+ ` ` ` yml
84
+ name : Build on Release
85
+ on :
86
+ release :
87
+ types : [created]
88
+
89
+ jobs :
90
+ build :
91
+ runs-on : ubuntu-latest
92
+ steps :
93
+ - name : Checkout code
94
+ uses : actions/checkout@v2
95
+ - name : Run a one-line script
96
+ run : echo Hello, Pull Request Event!
97
+ ` ` `
You can’t perform that action at this time.
0 commit comments