Skip to content
CAMPUXClass 39 · Production pipelines
Start

Run one step, then check it

Read the step before copying. Bash commands belong in Git Bash on Windows or Azure Cloud Shell set to Bash; PowerShell uses different syntax. A JSON, YAML, Bicep or application-code example belongs in the named file, not directly at the terminal prompt. Follow any shell-specific instructions below.

Keep the same terminal open so earlier variables remain available. Copy one complete command block without the terminal's $ prompt. A backslash continues a command onto the next line. If Bash shows a lone >, it is waiting for the rest of a quote, command or file block. Finish the complete block; if the paste was incomplete, press Ctrl+C and copy it again. Do not paste the next step into an unfinished command.

A line such as RG="training-group" stores a value without printing it. Output captured with $(...) is also stored; a blank screen alone does not prove failure. A sleep deliberately waits, and -o none suppresses normal output. Wait for your normal prompt, then run the step's checkpoint. After an error, stop and keep the exact command and message; later steps cannot repair a missing resource. Never share passwords, access tokens or secret values in a screenshot.

Hands-on lab · Class 39b

Build your first workflow.

In about twenty minutes, you will give GitHub a small job to run, watch it check a pull request, and inspect the file it saves. Then you will remove one required step, see the failure, and put it back.

GitHub account and repository required · no Azure login · runner usage depends on your GitHub plan

This lab teaches the first half of Class 39’s larger release: events, jobs, runners, checkout, and artifacts. The complete course later adds tests, Azure deployment, OIDC, and protected environments.

01

Create a tiny repository

In GitHub, create a repository named first-actions-workflow. A private repository is fine. Add a README file so the workflow has a file to check. Open the repository’s Actions tab; you will return there to inspect each run.

Before you start: GitHub-hosted runner availability and included usage vary by plan and repository. Check the Actions usage page for your account if a run is queued or billing is a concern.
02

Add the workflow file

Use Add file → Create new file. Name it .github/workflows/first.yml. The folders are part of the required path; GitHub only discovers workflow files inside .github/workflows.

Paste this complete example, then commit it to the repository’s default branch:

name: First workflow

on:
  push:
  pull_request:

permissions:
  contents: read

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      - name: Confirm the README is present
        run: test -f README.md

      - name: Create a tiny build output
        run: |
          mkdir -p site
          printf '%s\n' '<h1>Built by GitHub Actions</h1>' > site/index.html

      - uses: actions/upload-artifact@v7
        with:
          name: sample-site
          path: site/
          if-no-files-found: error

on lists the events that start the workflow. GitHub gives the job an Ubuntu runner. The checkout action copies repository files onto it; the test then confirms the README arrived. The last action saves the generated site/ folder as a downloadable artifact.

03

Read the run before trusting the green mark

Open Actions → First workflow and select the latest run. Open the check job and expand each step. Confirm that checkout ran before the README check, and that the artifact step completed.

Open the run’s summary and download sample-site. The ZIP contains index.html. The artifact belongs to this workflow run; it is how another job can receive the same built files later.

What “green” means here: every step in this job exited successfully. It does not prove an application is secure or ready for production; this lab has no production deployment.
04

Break checkout, then diagnose the message

Edit first.yml and temporarily remove the step that uses actions/checkout. Commit the change. Open the new run and read the failure from Confirm the README is present.

The command reports that README.md is missing because a fresh runner does not automatically contain your repository. The test did not cause the problem; it revealed that the workflow skipped the step that supplies the source files.

05

Restore the required step

Put actions/checkout@v6 back before the README check and commit again. Confirm that the new run succeeds and that its artifact downloads. You have now seen both the failure and the exact fix.

  • Events start workflow runs.
  • A job runs on a runner; its steps execute in order.
  • Checkout puts repository files on the runner.
  • An artifact carries output beyond the job that created it.
06

Classes 39e–39h · Check and promote the same artifact

Keep the disposable repository from this lab. Download the complete continuation workflow and save it as .github/workflows/artifact-gate.yml. It runs only when started manually. It creates a text file, records its SHA-256, checks the downloaded artifact, and passes those same bytes to a release rehearsal. It does not deploy to Azure.

  1. Commit the workflow, open Actions → Artifact gate practice, and select Run workflow. Expect build, check and release-rehearsal to succeed. Read each log and compare the artifact name and checksum.
  2. Break only the grep expectation: change Campux catalogue in the check job to Wrong catalogue. Run again. Expect check to fail and release-rehearsal to be skipped. This demonstrates a gate, not application coverage.
  3. Restore the correct expectation and rerun. Expect the checksum and content checks to succeed. Changing a check is a code change requiring review in real work.
  4. For Class 39f, open Settings → Environments → training-release. If your repository plan and visibility support required reviewers, add a reviewer and prevent self-review. Rerun: expect the rehearsal to wait before its steps execute. Have the designated reviewer approve. If the controls are unavailable, record that limitation; a named environment alone is not an approval gate.
  5. Record the artifact digest, failed run, skipped job and any observed approval pause. Delete the practice repository or workflow/environment when finished; retention and Actions usage depend on your account.
Check your reasoning

The check job uses the build output, and the rehearsal downloads that output again. It does not rebuild. The needs dependency prevents the rehearsal after a failed check. A checksum confirms file identity; it does not prove security or production readiness. Required reviewer support is documented in GitHub’s environment documentation.

Next

Now connect the workflow to a real release.

Class 39b shows how the same ideas extend to test gates, a build artifact, GitHub environment protection, and Azure deployment through OIDC. Class 39i returns to the security boundaries that keep the path trustworthy.

Return to Class 39b · Read pipeline security