Skip to content

Github Actions Demo

Github Actions Demo #6

name: Github Actions Demo
on:
push:
branches: main
pull_request:
branches: main
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
type: environment
required: true
schedule:
- cron: '15 6 * * 0'
jobs:
Build:
name: 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/checkout@v4
- name: List files in the repository
run: |
echo "The repository ${{ github.repository }} contains the following files:"
tree
Test:
name: Test
environment: Test
needs: Build
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- run: echo "Testing..."
Load-Test:
name: Load-Test
environment: Load-Test
needs: Build
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- run: echo "Testing..."
Deploy:
name: Deploy-${{ inputs.environment}}
environment:
name: ${{ inputs.environment}}
url: "https://writeabout.net"
runs-on: ubuntu-latest
needs: [Test, Load-Test]
steps:
- run: echo "Step x deploying... "
- run: echo "Step x deploying... "
- run: echo "Step x deploying... "
- run: echo "Step x deploying... "
- run: echo "Step x deploying... "