generated from ps-actions-sandbox/ActionsFundamentals
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (60 loc) · 1.4 KB
/
environmentest.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
61
62
63
64
65
66
67
name: GitHub Environment Demo
on:
workflow_dispatch:
inputs:
environment:
description: "Select environment"
type: environment
required: true
jobs:
Build:
runs-on: ubuntu-latest
steps:
- run: |
echo "🎉 The job was triggered by event: ${{ github.event_name }}"
echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ."
- uses: actions/[email protected]
- name: List files in the repository
run: |
echo "The repository ${{ github.repository }} contains the following files:"
tree
Test:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
needs: Build
environment: Test
steps:
- run: |
echo "Testing..."
Load-Test:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
needs: Build
environment: Load-Test
steps:
- run: |
echo "Testing..."
sleep 15
Production:
runs-on: ubuntu-latest
needs: [Test, Load-Test]
environment:
name: Production
url: https://writeabout.net
if: github.event.inputs.environment == 'Production'
steps:
- run: |
echo "Step 1 deploying..."
sleep 10
- run: |
echo "Step 2 deploying..."
sleep 10
- run: |
echo "Step 3 deploying..."
sleep 10
- run: |
echo "Step 4 deploying..."
sleep 10
- run: |
echo "Step 5 deploying..."
sleep 10