Demo 5 - Collaborating using Git and GitHub - CI/CD & GitHub Actions¶
This demo uses GitHub Actions as one example of Continuous Integration and Continuous Delivery / Deployment.
Task 1 - GitHub Actions Overview - one example for CI/CD¶
Step 1-1 - GitHub Actions documentation - https://docs.github.com/en/actions¶
Step 1-2 - GitHub Actions training material - https://docs.github.com/en/actions/learn-github-actions¶
Step 1-3 - GitHub Actions marketplace for actions - https://github.com/marketplace?type=actions¶
Step 1-4 - GitHub Actions marketplace for applications - https://github.com/marketplace?type=apps¶
Task 2 - GitHub Actions - demonstration with open-source Nautobot¶
Step 2-1 - Nautobot open source code on github - https://github.com/nautobot/nautobot¶
Step 2-2 - GitHub Actions with Nautobot¶
Click on Actions in the top center. See:
1) Immediately beneath is a list stating All workflows - Showing runs from all workflows and
2) On the left Workflows with a button beneath by default stating All workflows.
Step 2-3 - List in center shows runs from all workflows¶
-
Immediately below the 2-line title is an optional not-yet-implemented filter.
-
Beneath that is the number of workflow runs. To the right of that are selectable menu options for
Event,Status,Branch, andActor. You can select these and then unselect the choices as desired. -
Further below is the list of completed workflow runs. Each multiline row has a title, a description, a link, how long ago this workflow was run, the workflow run duration, and a 3-dot ellipsis. Clicking on the ellipsis gives options such as to
View workflow filewhich shows the contents of the workflow file.
Step 2-4 - List on left shows the possible workflows¶
The list of possible workflows is on the left. Clicking on Release will show to the center right only the completed workflows for the Release type of workflow.
Click on the top completed workflow, something like v1.3.8 - 2022-07-11.
Step 2-5 - Details about one completed workflow - center section¶
In the upper part of this center section is a summary of the results.
Beneath that is the main code title and its event, plus a diagram of the workflow logic, with blocks showing the multiple jobs run together that are effectively prerequisites (that must be completed first) before proceeding to the right for the next block, and so on. Each of the jobs are shown in the left-hand pane.
Step 2-6 - Explore the code of a completed workflow¶
Click on the workflow file name (e.g. release.yml) to see the code used.
Step 2-7 - Explore individual code portions¶
Use the back arrow of the web browser to get back to the workflow diagram. Then click an individual item, such as starting on the left ci / black or ci /flake8. It is valid to run both linters as black will only reformat while flake8 can check for various issues not covered with black.