Skip to content

Commit

Permalink
add environment
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsvetkov-splunk authored Jul 10, 2024
1 parent 84d2fbb commit cf9cadb
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion .github/workflows/github-actions-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ on:
schedule:
- cron: '15 6 * * 0'
workflow_dispatch:

inputs:
environment:
description: 'Environment to deploy to'
type: environment
required: true
jobs:
Build:
runs-on: ubuntu-latest
Expand All @@ -22,3 +26,44 @@ jobs:
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..."
sleep 10
- run: |
echo "πŸš€ Step 2..."
sleep 10
- run: |
echo "πŸš€ Step 3..."
sleep 10
- run: |
echo "πŸš€ Step 4..."
sleep 10
- run: |
echo "πŸš€ Step 5..."
sleep 10

0 comments on commit cf9cadb

Please sign in to comment.