Interview Prep/CI/CD/GitHub Actions

Builds must produce a binary in one job and use it in a later job on a different runner.

BeginnerScenarioGitHub Actions
Answer

Situation read → Jobs do not share a filesystem.

What I'd do →

- uses: actions/upload-artifact@v4
  with: { name: app, path: dist/, retention-days: 7 }
# later job
- uses: actions/download-artifact@v4
  with: { name: app }

Add needs: build to the consuming job.

Why → Artifacts move files between jobs; caches speed up dependencies - different tools.

Interview tip → In v4 artifact names must be unique per run, and matrix jobs need distinct names.

All CI/CD questions

More on GitHub Actions