Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 3.54 KB

File metadata and controls

45 lines (31 loc) · 3.54 KB

Lab02 - Reuse and Artifacts

Title Description
Target Learn how to use Composite Actions and publish artifacts
Difficulty Medium
Measure Build succeeds
Threat N/A
Detect N/A
Prevent N/A
Stage Build, Deploy
Known problems N/A

GitHub Actions allows you to reuse common logic or complete workflows across multiple repositories by creating Composite Actions or Reusable Workflows. This helps you maintain consistency and reduce duplication of code across your projects and environments.

This table shows the difference between Composite Actions and Reusable Workflows and helps you decide which one to use for your use case.

Another important aspect for build pipelines is the ability to share artifacts between jobs or workflows. Artifacts are files that are produced by a job and uploaded to GitHub for later use. You can think of them as a versioned package that can be downloaded and reused. For example, you might want to deploy the same binary to multiple environments or run additional tests on the same build output.

In this lab, you will learn how to call on existing Composite Actions and Reusable Workflows, and how to publish artifacts from your build pipeline to be used by later jobs or workflows.

Reuse Existing Actions and Workflows

Publish artifacts

Use the actions/upload-artifact@v4 action to publish the binary produced by .github/actions/build-dotnet-app as an artifact based on the outputs of the Composite Action.

Links

Example solution

It is better to try by yourself first, but when you are done with that here is a solution for the task