GitHub Actions Demo #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub Actions Demo | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: [.github/**] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '15 6 * * 0' | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Pick an environment' | |
required: true | |
default: 'Production' | |
options: | |
- 'Production' | |
- 'Staging' | |
- 'Development' | |
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 | |
Job1: | |
runs-on: ubuntu-latest | |
needs: Build | |
environment: | |
name: Load-Test | |
steps: | |
- name: Run Load Test | |
if: github.event_name == 'workflow_dispatch' | |
run: echo "Testing..." | |
Production: | |
needs: [Build, Job1] | |
runs-on: ubuntu-latest | |
environment: | |
name: Production | |
url: https://writeabout.net | |
steps: | |
- name: Step 1 deploying ... | |
run: | | |
echo "Step 1 deploying ..." | |
sleep 10 | |
- name: Step 2 deploying ... | |
run: | | |
echo "Step 2 deploying ..." | |
sleep 10 | |
- name: Step 3 deploying ... | |
run: | | |
echo "Step 3 deploying ..." | |
sleep 10 | |
- name: Step 4 deploying ... | |
run: | | |
echo "Step 4 deploying ..." | |
sleep 10 | |
- name: Step 5 deploying ... | |
run: | | |
echo "Step 5 deploying ..." | |
sleep 10 | |