From cf8d54586557ffe2e2c70f125061d5df9af6737e Mon Sep 17 00:00:00 2001 From: Rune Moberg Date: Fri, 10 Nov 2023 12:15:12 +0100 Subject: [PATCH] Check event_name and set environment --- .github/workflows/github-actions-demo.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index c93c8c3..edc7177 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -1,10 +1,17 @@ name: GitHub Actions Demo run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 -on: [push, pull_request] +on: + push: + branches: ["main"] + pull_request: + release: jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest + env: + Environment: ${{ github.event_name == 'release' && 'prod' || 'dev' }} steps: + - run: echo "We are targetting the '$Environment' environment." - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."