Skip to content
Ameen Abozaid
Planned lessonJNR-051-L04

Artifacts and image publishing

  • Lesson 4 of 7
  • Junior
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

publish the JAR and a container image with version tags.

Planned topics

  • Artifacts are build outputs (JAR, test reports); actions/upload-artifact keeps them with the run.
  • Images go to a registry such as GitHub Container Registry (ghcr.io).
  • Log in with the built-in GITHUB_TOKEN (set permissions: packages: write) instead of a personal password.
  • Tag images with the commit SHA and a version, not only latest.
  • Build once and promote the same image through environments.
Draft outline details

Demonstration

yaml
- uses: docker/login-action@v3
  with: { registry: ghcr.io, username: ${{ github.actor }}, password: ${{ secrets.GITHUB_TOKEN }} }
- uses: docker/build-push-action@v6
  with: { push: true, tags: "ghcr.io/${{ github.repository }}:${{ github.sha }}" }

Check your understanding

Why tag with the commit SHA?

Show answer

You can trace and roll back to the exact build.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.