-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (62 loc) · 2.54 KB
/
initial-workflow.yaml
File metadata and controls
79 lines (62 loc) · 2.54 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
71
72
73
74
75
76
77
78
79
name: Github Actions Demo
on:
#trigger by external events(api) with event_types declared
repository_dispatch:
types: [run_my_workflow]
#manual triggers with parameters
workflow_dispatch:
inputs:
name:
description: 'Enter the Name'
required: true
default: 'Github User'
deploy:
description: Deploy code after build(yes/no)'
required: false
default: 'yes'
#github event triggers
push:
branches: [ "main" ]
jobs:
Example-Actions-Job:
name: Exploring Github aActions
runs-on: ubuntu-latest
steps:
# Display the event that triggered the workflow
- run: echo "The job was triggered by a ${{ github.event_name }} event."
# Passed parameter
- run: echo "Name ${{ github.event.inputs.name }}"
- run: echo "Deploy code - ${{ github.event.inputs.deploy }}"
# Runner information
- run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub"
# Information about the repository and branch
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
# Use Action located in https://github.com/actions
- name: Check out repository code
uses: actions/checkout@v2
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "Your repository has been copied to the path ${{ github.workspace }} on the runner."
- run: echo "The workflow is now ready to test your code on the runner."
- name: conditional step when event name is pull request
if: ${{ github.event_name == 'pull_request' }}
run: echo "This event is a pull request"
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- name: Setup dotnet on runner
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.x'
- name: Display dotnet version
run: dotnet --version
- run: echo "The preinstalled tools are located here on the runner ${{ runner.tool_cache }}."
- name: List files in tool cache
run: |
ls ${{ runner.tool_cache }}
- run: echo "This job's status is ${{ job.status }}."
Second-Job:
name: The second job running on another runner
runs-on: windows-latest
needs: Example-Actions-Job
steps:
- run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub."