diff --git a/.github/workflows/05-conditionals.yml b/.github/workflows/05-conditionals.yml index a3d984f..cad4eec 100644 --- a/.github/workflows/05-conditionals.yml +++ b/.github/workflows/05-conditionals.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: 04 Conditionals +name: 05 Conditionals # Controls when the workflow will run on: @@ -20,7 +20,7 @@ env: # 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: + hello: # The type of runner that the job will run on runs-on: ubuntu-latest if: ${{ env.Greeting == 'Hello'}} @@ -33,3 +33,17 @@ jobs: # Runs a single command using the runners shell - name: Run a one-line script 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!" diff --git a/.github/workflows/06-expressions.yml b/.github/workflows/06-expressions.yml new file mode 100644 index 0000000..374d211 --- /dev/null +++ b/.github/workflows/06-expressions.yml @@ -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" \ No newline at end of file diff --git a/.github/workflows/contexts.yml b/.github/workflows/07-contexts.yml similarity index 96% rename from .github/workflows/contexts.yml rename to .github/workflows/07-contexts.yml index 6460d2a..62e223f 100644 --- a/.github/workflows/contexts.yml +++ b/.github/workflows/07-contexts.yml @@ -1,4 +1,4 @@ -name: Context testing +name: 07 Contexts on: push jobs: diff --git a/.github/workflows/08-secrets.yml b/.github/workflows/08-secrets.yml new file mode 100644 index 0000000..f20939e --- /dev/null +++ b/.github/workflows/08-secrets.yml @@ -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 }} + \ No newline at end of file