Giter Club home page Giter Club logo

cicd_containerimgs's Introduction

03_04_ci_cd_for_container_images

This lesson demonstrates how to set up a CI/CD workflow for container images.

Specifically, this demo implements a delivery workflow that:

  • Reuses a workflow to run integration tests
  • Collects metadata
  • Builds the image
  • Publishes the image to GitHub Packages

Using the Exercise Files

  1. Create a new repo and upload the files for this lesson.

  2. Rename the file python-ci-workflow.yml so that its located in the .github/workflows directory.

     Completing this step is key to having the workflow run properly!
    
  3. In the repo select the Actions tab.

  4. Select and configure the workflow Publish Docker Container.

  5. Under jobs, add an ID named “integration” and the keyword uses followed by the path to python-ci-workflow.yml.

    NOTE that the path to the workflow starts with ./ and contains the full path the workflow file.

    Add a permissions block followed by contents: read and checks: write.

    The completed call to the reused workflow should be similar to the following:

     jobs:
         integration:
             uses: ./.github/workflows/python-ci-workflow.yml
             permissions:
             contents: read
             checks: write
    
  6. Under the job with the ID build, add needs, followed by the ID for the integration job. This will cause the build job to wait for the integration job to complete.

     build:
         needs: [integration]
    
  7. Select Start Commit and then select Commit New File.

  8. Select the Actions tab.

  9. Select the running workflow.

  10. Observe the integration/build job followed by the build job.

  11. Observe the updates to the Actions UI as the integration/build job completes.

  12. Once the workflow completes, select the Code tab.

  13. Refresh the page as needed until the package is listed under Packages.

  14. Select the package and review the details on the package page.

Fixing Warnings in the Annotations Section

At the time this course was published, the Publish Docker Container workflow contained actions based on Node 12.

Node 12 has been out of support since April 2022 and has been deprecated by Github Actions.

This causes warnings to be written to the Actions UI.

To remove these warnings, the version for actions used in this workflow need to be updated.

Update your workflow to use the following actions with the indicated versions. Also, check the provided Marketplace page to see if newer versions are available.

Action Marketplace Page Action Name and Version
Docker Setup Buildx docker/[email protected]
Docker Login docker/[email protected]
Docker Metadata action docker/[email protected]
Build and push Docker images docker/[email protected]

cicd_containerimgs's People

Contributors

lalitacloud avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.