Artifacts and image publishing
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-artifactkeeps them with the run. - Images go to a registry such as GitHub Container Registry (
ghcr.io). - Log in with the built-in
GITHUB_TOKEN(setpermissions: 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
- 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.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.