updated workflows

This commit is contained in:
Chris Ayers
2022-06-29 12:18:08 -04:00
parent f5c4b90948
commit 0dbb0ae627
4 changed files with 99 additions and 3 deletions
+16 -2
View File
@@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions # This is a basic workflow to help you get started with Actions
name: 04 Conditionals name: 05 Conditionals
# Controls when the workflow will run # Controls when the workflow will run
on: on:
@@ -20,7 +20,7 @@ env:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel # A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs: jobs:
# This workflow contains a single job called "build" # This workflow contains a single job called "build"
build: hello:
# The type of runner that the job will run on # The type of runner that the job will run on
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ env.Greeting == 'Hello'}} if: ${{ env.Greeting == 'Hello'}}
@@ -33,3 +33,17 @@ jobs:
# Runs a single command using the runners shell # Runs a single command using the runners shell
- name: Run a one-line script - name: Run a one-line script
run: echo "$Greeting, $Name!" run: echo "$Greeting, $Name!"
bye:
# The type of runner that the job will run on
runs-on: ubuntu-latest
if: ${{ env.Greeting == 'Goodbye'}}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo "$Greeting, $Name!"
+43
View File
@@ -0,0 +1,43 @@
# This is a basic workflow to help you get started with Actions
name: 06 Expressions
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
formatting: ${{ format('{{Hello {0} {1} {2}!}}', 'Mona', 'the', 'Octocat') }}
endsWith: ${{ endsWith('Hello world', 'ld') }}
containsString: ${{ contains('Hello world', 'llo') }}
presenters: ${{ fromJson('["Chris","Michael","Mauro"]') }}
containsArray: ${{ contains(env.presenters, 'chris') }}
presentersString: ${{ join(env.presenters, ', ') }}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
job1:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell
- name: Print formatting
run: echo "$formatting"
- name: Print endsWith
run: echo "$endsWith"
- name: Print containsString
run: echo "$containsString"
- name: Print containsArray
run: echo "$containsArray"
- name: Print Presenters
run: echo "$presentersString"
@@ -1,4 +1,4 @@
name: Context testing name: 07 Contexts
on: push on: push
jobs: jobs:
+39
View File
@@ -0,0 +1,39 @@
# This is a basic workflow to help you get started with Actions
name: 08 Secrets
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
Greeting: 'Hello'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo "$Greeting, ${{ secrets.Name }}!"
- name: Run a one-line script
run: echo "$Greeting, $Name!"
env:
Name: ${{ secrets.Name }}