Skip to content

Github Actions Demo

Github Actions Demo #2

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"}}

Check failure on line 37 in .github/workflows/github-actions-demo.yml

View workflow run for this annotation

GitHub Actions / Github Actions Demo

Invalid workflow file

The workflow is not valid. .github/workflows/github-actions-demo.yml (Line: 37, Col: 9): Unexpected symbol: '"workflow_dispatch"'. Located at position 22 within expression: github.event_name == "workflow_dispatch" .github/workflows/github-actions-demo.yml (Line: 46, Col: 9): Unexpected symbol: '"workflow_dispatch"'. Located at position 22 within expression: 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... "