Skip to content

Demo Workflow

Demo Workflow #8

Workflow file for this run

name: Demo Workflow
run-name: Demo Workflow
on:
push:
branches:
- main
env:
ENV: "This is an environment variable"
SEC: ${{ secrets.DEMO}}
jobs:
test:
runs-on: ubuntu-latest
outputs:
hello: ${{ steps.hello.outputs.hello }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dependencies
run: npm ci
- name: Test
run: npm test
- name: Create Hello.txt
run: echo "Hello, World!" > Hello.txt
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Hello
path: ./Hello.txt
- name: Creating an Output
id: hello
run: echo "::set-output name=hello::Hello, World!"
echo:
runs-on: ubuntu-latest
needs: test
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: Hello
- name: Print Hello
run: cat Hello.txt
- name: Output the Output
run: echo "The output is ${{ needs.test.outputs.hello }}"
- name: Echo Env
run: echo $env.ENV
- name: Echo Secret
run: echo $env.SEC