Goal: Add a GitHub Actions workflow to your capstone repository that automatically lints/tests your code, builds your capstone's Docker image, and pushes a versioned image to GitHub Container Registry (GHCR) on every push — with zero hardcoded credentials. All tools used are free (GitHub Actions free minutes + GHCR are free for public repos, and free-tier minutes apply to private repos too). Steps:
docker build . still succeeds locally. If not, write a minimal Dockerfile now (base image, copy source, install dependencies, set entrypoint)..github/workflows/ci.yml in your capstone repo. Structure it as separate jobs so stages can fail fast and run independently:lint-test job that checks out the code, sets up your language runtime, installs dependencies, and runs your linter and test suite.build-and-push job (which needs: lint-test) that only runs if linting/tests pass.build-and-push job, log in using the built-in GITHUB_TOKEN (automatically provided by GitHub Actions — no manual secret setup required for GHCR):- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
docker/build-push-action with cache-from/cache-to set to type=gha so repeated builds reuse layers instead of rebuilding from scratch:- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
${{ github.sha }}) so every push produces a traceable, unique image; optionally also tag latest on pushes to main.on: push (and optionally pull_request for the lint-test job only, so PRs get feedback before merge without pushing an image).git grep for anything that looks like a key or token) and confirm the only credential references in ci.yml are ${{ secrets.* }} expressions — nothing in plain text.Deliverables: Submit (a) the URL to your capstone repo's .github/workflows/ci.yml file, (b) a screenshot of a green pipeline run in the Actions tab, and (c) a screenshot of the resulting versioned image in your GHCR Packages tab, along with a short written reflection (150–250 words) on one decision you made while building the pipeline and why.