AcademyPipeline Pilot: The CI/CD Flight ManualAltitude 3: Stealth Mode (Secrets)

Environment Variables

Environment variables can be defined at the workflow, job, or step level using the env keyword.

name: CI
on: push

# Workflow level ENV
env:
  APP_NAME: "MyApp"
  NODE_ENV: "production"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Print ENV
        run: echo "Building $APP_NAME for $NODE_ENV"

Contexts

You can access variables dynamically using Context expressions like ${{ env.APP_NAME }}. This is useful when passing variables to actions instead of shell commands.

booting...

Mission Control

Add env block

Expected Command

nano .github/workflows/main.yml