Continuous integration and delivery (CI/CD) streamline and accelerate the process and time it takes to deliver new features to our users, from the initial idea to successful release in production. Until your software is finally in the hands of your customers, your return on investment is zero. So, it’s important to be able to get your app and all its subsequent feature improvements or patches delivered to your users as quickly and reliably as possible.
One GitHub feature often used in the CI/CD deployment pipeline is GitHub Actions, used to automate tasks within your software development life cycle. Workflows in GitHub Actions are event-driven, meaning that you configure a series of actions to run after a specific event has occurred. So, you can create custom workflows directly in your GitHub repository. For example, you can trigger a workflow when someone pushes to branch, creates a pull request, publishes a release or even on a regular schedule.
Actions are managed in the same place as all your other repository related features like pull requests and issues, enabling you to manage continuous integration (CI) and continuous deployment (CD) code directly in your repository.
GitHub Actions for streamlining deployments to OCI
The following common GitHub actions from Oracle help streamline the deployment process from GitHub to Oracle Cloud Infrastructure (OCI). All the actions use the same method of configuration authentication credentials, so you only need to configure them once per workflow.
Run an OCI CLI command
This action automatically installs the latest version of OCI CLI and then runs the provided command, automatically redacting any authentication details and other customer-specific identifiers from the log output. You can use the output from this command as input for subsequent actions.
Configure Kubectl for Oracle Container Engine for Kubernetes (OKE)
This action identifies the specified OKE cluster then installs and configures the correct version of kubectl for that cluster. Kubectl is then available for all subsequent actions in a workflow and retains its configuration only while the workflow is active. The Kubernetes Cluster API must be publicly accessible for this action to work, either directly or through a load balancer.
Get or create an Oracle Cloud Infrastructure Registry (OCIR) container image repository
This action takes the name of a repository and the OCID of the compartment in which that repository was created and outputs both the OCID of the repo itself and the URI to the repository in the exact format required by both Docker and Podman. If the image repository doesn’t already exist, it is created automatically.
Log in to OCIR
This action requires an auth_token to create an ephemeral credential store for Docker and Podman. Combine this action with the previous action to push a container image built on GitHub to OCI.
Conclusion
The use of these GitHub actions for OCI deployments is an excellent way to have your deployment pipelines embed OCI CLI commands and Kubernetes CLI commands. The actions ensure that the pipeline is authenticated to OCI and OKE. GitHub Actions makes it easy to automate all your software workflows allowing you to build, test, and deploy your code on Oracle Cloud Infrastructure right from GitHub.


