-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (65 loc) · 1.59 KB
/
ci.yaml
File metadata and controls
70 lines (65 loc) · 1.59 KB
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
name: Hello World CI
on:
pull_request:
branches:
- main
- staging
- dev
push:
branches:
- main
- staging
- dev
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
inputs:
dump_context:
description: Print GH context
type: boolean
default: false
env:
SOME_VAR: "some value"
SOME_SECRET: ${{ secrets.SAMPLE_SECRET }}
jobs:
hello-world:
name: Hello World
runs-on: ubuntu-latest
env:
SOME_OTHER_VAR: "some other value"
steps:
- name: Say Hello
run: echo "Hello World!"
- name: Use var
run: echo ${{ env.SOME_VAR }}
- name: Use secret
run: |
echo secret SAMPLE_SECRET = ${{ secrets.SAMPLE_SECRET }}
echo env SOME_SECRET = ${{ env.SOME_SECRET }}
- name: Use other var
run: echo ${{ env.SOME_OTHER_VAR }}
- name: Yet another var
env:
YET_ANOTHER_VAR: "yet another value"
run: echo ${{ env.YET_ANOTHER_VAR }}
hello-again:
name: Hello Again
runs-on: ubuntu-latest
steps:
- name: Say Hello
run: echo "Hello Again World!"
conditional-job:
needs: hello-world
if: ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: optional step
if: ${{ github.event.inputs.dump_context == 'true' }}
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "Github context printed below"
echo "$GITHUB_CONTEXT"