Skip to content

Commit 7e35bcf

Browse files
authored
Update blank.yml
1 parent 9d8af20 commit 7e35bcf

File tree

1 file changed

+38
-17
lines changed

1 file changed

+38
-17
lines changed

.github/workflows/blank.yml

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,39 @@ name: CD
44

55
# Controls when the action will run.
66
on:
7-
# Triggers the workflow on push or pull request events but only for the main branch
8-
push:
9-
branches: [ main ]
10-
pull_request:
11-
branches: [ main ]
12-
137
# Allows you to run this workflow manually from the Actions tab
148
workflow_dispatch:
159

1610
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1711
jobs:
18-
# This workflow contains a single job called "build"
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
16+
- uses: actions/checkout@v2
17+
18+
- name: Run a one-line script
19+
run: echo Hello, world!
20+
21+
- name: Run a multi-line script
22+
run: |
23+
echo Add other actions to build,
24+
echo test, and deploy your project.
25+
1926
deploy-staging:
27+
needs: [build]
2028
if: github.ref == 'refs/heads/main'
21-
# The type of runner that the job will run on
2229
runs-on: ubuntu-latest
2330
environment: staging
2431

25-
# Steps represent a sequence of tasks that will be executed as part of the job
2632
steps:
27-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
33+
2834
- uses: actions/checkout@v2
2935

30-
# Runs a single command using the runners shell
36+
3137
- name: Run a one-line script
3238
run: echo Hello, world!
3339

34-
# Runs a set of commands using the runners shell
3540
- name: Run a multi-line script
3641
run: |
3742
echo Add other actions to build,
@@ -40,22 +45,38 @@ jobs:
4045
deploy-production:
4146
needs: [deploy-staging]
4247
if: github.ref == 'refs/heads/main'
43-
# The type of runner that the job will run on
48+
4449
runs-on: ubuntu-latest
4550
environment: production
4651

47-
# Steps represent a sequence of tasks that will be executed as part of the job
52+
4853
steps:
49-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
54+
5055
- uses: actions/checkout@v2
5156

52-
# Runs a single command using the runners shell
5357
- name: Run a one-line script
5458
run: echo Hello, world!
5559

56-
# Runs a set of commands using the runners shell
5760
- name: Run a multi-line script
5861
run: |
5962
echo Add other actions to build,
6063
echo test, and deploy your project.
6164
65+
deploy-review:
66+
needs: [build]
67+
if: github.event_name == 'pull_request'
68+
69+
runs-on: ubuntu-latest
70+
environment: review
71+
72+
steps:
73+
74+
- uses: actions/checkout@v2
75+
76+
- name: Run a one-line script
77+
run: echo Hello, world!
78+
79+
- name: Run a multi-line script
80+
run: |
81+
echo Add other actions to build,
82+
echo test, and deploy your project.

0 commit comments

Comments
 (0)