Skip to content

Commit

Permalink
Merge pull request #1452 from replicatedhq/89143
Browse files Browse the repository at this point in the history
Add info about using GitHub Actions in workflows
  • Loading branch information
paigecalvert authored Sep 25, 2023
2 parents 72fa8e2 + 27246c2 commit 637174e
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 30 deletions.
21 changes: 3 additions & 18 deletions docs/vendor/ci-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,9 @@ The following are Replicated's best practices and recommendations for CI/CD:

* Integrate the Replicated compatibility matrix into your CI/CD workflows to quickly create multiple different types of clusters where you can deploy and test your application. Supported distributions include OpenShift, GKE, EKS, and more. For more information, see [About the Compatibility Matrix](testing-about).

* If you use the GitHub Actions CI/CD platform, integrate the custom GitHub actions that Replicated maintains to replace repetitive tasks related to distributing application with Replicated or using the compatibility matrix. For more information, see [Integrating Replicated GitHub Actions](/vendor/ci-workflows-github-actions).

* To help show you are conforming to a secure supply chain, sign all commits and container images. Additionally, provide a verification mechanism for container images.

* Incorporating code tests into your CI/CD workflows is important for ensuring that developers receive quick feedback and can make updates in small iterations. Replicated recommends that you create and run all of the following test types as part of your CI/CD workflows:
<TestRecs/>

## GitHub Actions
Replicated maintains custom actions and example workflows that that are compatible with the GitHub Action CI/CD platform. Users of GitHub Actions can use these actions and example workflows to help create their own CI/CD workflows.

### Replicated Custom Actions

Replicated maintains a set of custom actions that are designed to replace repetitive tasks such as creating and removing customers, channels, clusters, and more. If you use GitHub Actions as your CI/CD platform, you can include these custom actions in your workflows rather than using replicated CLI commands.

For more information, see the [replicated-actions](https://github.com/replicatedhq/replicated-actions/) repository in GitHub.

### Example GitHub Action Workflows

The [replicatedhq/replicated-actions](https://github.com/replicatedhq/replicated-actions#examples) repository in GitHub contains example GitHub Actions workflows that you can use as a template for your own CI/CD pipelines:
* For a simplified development workflow that uses the `cluster prepare` command to avoid the need to create a release, channel, or customer for testing, see [development-helm-prepare-cluster.yaml](https://github.com/replicatedhq/replicated-actions/blob/main/example-workflows/development-helm-prepare-cluster.yaml).
* For a customizable development workflow for applications installed with the Helm CLI, see [development-helm.yaml](https://github.com/replicatedhq/replicated-actions/blob/main/example-workflows/development-helm.yaml).
* For a customizable development workflow for applications installed with KOTS installations, see [development-kots.yaml](https://github.com/replicatedhq/replicated-actions/blob/main/example-workflows/development-kots.yaml).
* For a release workflow, see [release.yaml](https://github.com/replicatedhq/replicated-actions/blob/main/example-workflows/release.yaml).
<TestRecs/>
128 changes: 128 additions & 0 deletions docs/vendor/ci-workflows-github-actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Integrating Replicated GitHub Actions

This topic describes how to integrate Replicated's custom GitHub actions into continuous integration and continuous delivery (CI/CD) workflows that use the GitHub Actions platform.

## Overview

Replicated maintains a set of custom GitHub actions that are designed to replace repetitive tasks related to distributing your application with Replicated and related to using the compatibility matrix, such as:
* Creating and removing customers, channels, and clusters
* Promoting releases
* Creating a matrix of clusters for testing based on the Kubernetes distributions and versions where your customers are running application instances
* Reporting the success or failure of tests

If you use GitHub Actions as your CI/CD platform, you can include these custom actions in your workflows rather than using replicated CLI commands. Integrating the Replicated GitHub actions into your CI/CD pipeline helps you quickly build workflows with the required inputs and outputs, without needing to manually create the required CLI commands for each step.

To view all the available GitHub actions that Replicated maintains, see the [replicatedhq/replicated-actions](https://github.com/replicatedhq/replicated-actions/) repository in GitHub.

## GitHub Actions Workflow Examples

The [replicatedhq/replicated-actions](https://github.com/replicatedhq/replicated-actions#examples) repository in GitHub contains example workflows that use the Replicated GitHub actions. You can use these workflows as a template for your own GitHub Actions CI/CD workflows:

* For a simplified development workflow, see [development-helm-prepare-cluster.yaml](https://github.com/replicatedhq/replicated-actions/blob/main/example-workflows/development-helm-prepare-cluster.yaml).
* For a customizable development workflow for applications installed with the Helm CLI, see [development-helm.yaml](https://github.com/replicatedhq/replicated-actions/blob/main/example-workflows/development-helm.yaml).
* For a customizable development workflow for applications installed with KOTS, see [development-kots.yaml](https://github.com/replicatedhq/replicated-actions/blob/main/example-workflows/development-kots.yaml).
* For a release workflow, see [release.yaml](https://github.com/replicatedhq/replicated-actions/blob/main/example-workflows/release.yaml).

## Integrate GitHub Actions

The following table lists GitHub actions that are maintained by Replicated that you can integrate into your CI/CI workflows. The table also describes when to use the action in a workflow and indicates the related replicated CLI command where applicable.

:::note
For an up-to-date list of the avilable custom GitHub actions, see the [replicatedhq/replicated-actions](https://github.com/replicatedhq/replicated-actions/) repository in GitHub.
:::

<table>
<tr>
<th width="25%">GitHub Action</th>
<th width="50%">When to Use</th>
<th width="25%">Related replicated CLI commands</th>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/archive-channel">archive-channel</a></td>
<td>
<p>In release workflows, a temporary channel is created to promote a release for testing. This action archives the temporary channel after tests complete.</p>
<p>See <a href="/vendor/ci-workflows#rel-cleanup">Archive the temporary channel and customer</a> in <em>Recommended CI/CD Workflows</em>.</p>
</td>
<td><a href="/reference/replicated-cli-channel-delete"><code>channel delete</code></a></td>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/archive-customer">archive-customer</a></td>
<td>
<p>In release workflows, a temporary customer is created so that a release can be installed for testing. This action archives the temporary customer after tests complete.</p>
<p>See <a href="/vendor/ci-workflows#rel-cleanup">Archive the temporary channel and customer</a> in <em>Recommended CI/CD Workflows</em>.</p>
</td>
<td>N/A</td>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/create-cluster">create-cluster</a></td>
<td>
<p>In release workflows, use this action to create one or more clusters for testing.</p>
<p>See <a href="/vendor/ci-workflows#rel-deploy">Create cluster matrix, deploy, and test</a> in <em>Recommended CI/CD Workflows</em>.</p>
</td>
<td><a href="/reference/replicated-cli-cluster-create"><code>cluster create</code></a></td>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/create-release">create-release</a></td>
<td>
<p>In release workflows, use this action to create a release to be installed and tested, and optionally to be promoted to a shared channel after tests complete.</p>
<p>See <a href="/vendor/ci-workflows#rel-release">Create a release and promote to a temporary channel</a> in <em>Recommended CI/CD Workflows</em>. </p>
</td>
<td><a href="/reference/replicated-cli-release-create"><code>release create</code></a></td>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/get-customer-instances">get-customer-instances</a></td>
<td>
<p>In release workflows, use this action to create a matrix of clusters for running tests based on the Kubernetes distributions and versions of active instances of your application running in customer environments.</p>
<p>See <a href="/vendor/ci-workflows#rel-deploy">Create cluster matrix, deploy, and test</a> in <em>Recommended CI/CD Workflows</em>.</p>
</td>
<td>N/A</td>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/helm-install">helm-install</a></td>
<td><p>In development or release workflows, use this action to install a release using the Helm CLI in one or more clusters for testing.</p>
<p>See <a href="/vendor/ci-workflows#rel-deploy">Create cluster matrix, deploy, and test</a> in <em>Recommended CI/CD Workflows</em>.</p>
</td>
<td>N/A</td>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/kots-install">kots-install</a></td>
<td>
<p>In development or release workflows, use this action to install a release with Replicated KOTS in one or more clusters for testing.</p>
<p>See <a href="/vendor/ci-workflows#rel-deploy">Create cluster matrix, deploy, and test</a> in <em>Recommended CI/CD Workflows</em>.</p>
</td>
<td>N/A</td>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/prepare-cluster">prepare-cluster</a></td>
<td>
<p>In development workflows, use this action to create a cluster, create a temporary customer of type <code>test</code>, and install an application in the cluster.</p>
<p>See <a href="/vendor/ci-workflows#dev-deploy">Prepare clusters, deploy, and test</a> in <em>Recommended CI/CD Workflows</em>.</p>
</td>
<td><a href="/reference/replicated-cli-cluster-prepare"><code>cluster prepare</code></a></td>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/promote-release">promote-release</a></td>
<td>
<p>In release workflows, use this action to promote a release to an internal or customer-facing channel (such as Unstable, Beta, or Stable) after tests pass.</p>
<p>See <a href="/vendor/ci-workflows#rel-promote">Promote to a shared channel</a>in <em>Recommended CI/CD Workflows</em>.</p>
</td>
<td><a href="/reference/replicated-cli-release-promote"><code>release promote</code></a></td>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/remove-cluster">remove-cluster</a></td>
<td><p>In development or release workflows, use this action to remove a cluster after running tests if no <code>ttl</code> was set for the cluster.</p>
<p>See <a href="/vendor/ci-workflows#dev-deploy">Prepare clusters, deploy, and test</a> and <a href="/vendor/ci-workflows#rel-deploy">Create cluster matrix, deploy, and test</a> in <em>Recommended CI/CD Workflows</em>.</p>
</td>
<td><a href="/reference/replicated-cli-cluster-rm"><code>cluster rm</code></a></td>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/report-compatibility-result">report-compatibility-result</a></td>
<td>In development or release workflows, use this action to report the success or failure of tests that ran in clusters provisioned by the compatibility matrix.</td>
<td>release compatibility</td>
</tr>
<tr>
<td><a href="https://github.com/replicatedhq/replicated-actions/tree/main/upgrade-cluster">upgrade-cluster</a></td>
<td>In release workflows, use this action to test your application's compatibility with Kubernetes API resource version migrations after upgrading.</td>
<td><a href="/reference/replicated-cli-cluster-upgrade"><code>cluster upgrade</code></a></td>
</tr>
</table>
Loading

0 comments on commit 637174e

Please sign in to comment.