Skip to content

Commit

Permalink
Merge pull request #523 from linear-b/remove-docker
Browse files Browse the repository at this point in the history
Removed docker from GitHub installation
  • Loading branch information
vim-zz committed May 29, 2024
2 parents b3eeb73 + 93b2ce2 commit 26e65d4
Showing 1 changed file with 12 additions and 42 deletions.
54 changes: 12 additions & 42 deletions docs/github-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@ Here are the steps to configure gitStream in your repo's branch protection rules

### Configuring gitStream with Self-Hosted Runners

To ensure gitStream runs on self-hosted GitHub Actions runners, follow these steps to configure it:
Follow these steps to ensure gitStream runs on self-hosted GitHub Actions runners:

1. **Configure Self-Hosted Runners with **
Ensure you have self-hosted runners set up for your GitHub organization or repository. Refer to the GitHub documentation on [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners) and [Using self-hosted runners in a workflow](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/using-self-hosted-runners-in-a-workflow) for detailed instructions.

1. **Install Docker and Git on Self-Hosted Runners**
Make sure your self-hosted runners have Docker and Git installed. These are essential dependencies for gitStream to function properly. You can follow the official installation guides for [Docker](https://docs.docker.com/get-docker/) and [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
1. **Configure Self-Hosted Runners**
- Set up self-hosted runners for your GitHub organization or repository. Refer to GitHub documentation on [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners) and [using them in a workflow](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/using-self-hosted-runners-in-a-workflow) for detailed instructions.

2. **Update GitHub Actions Configuration**
Open the gitStream GitHub Actions workflow file (`.github/workflows/gitstream.yml`) and update the `runs-on` field to specify that the gitStream job must run on self-hosted runners. For example:
2. **Install Git on Self-Hosted Runners**
- Ensure Git is installed on your self-hosted runners. Git is a necessary dependency for gitStream. Installation instructions can be found [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).

3. **Update GitHub Actions Configuration**
- Modify the gitStream GitHub Actions workflow file (`.github/workflows/gitstream.yml`) to specify self-hosted runners:

```yaml
jobs:
Expand All @@ -142,42 +142,12 @@ To ensure gitStream runs on self-hosted GitHub Actions runners, follow these ste
# ... other configuration ...
```

3. **Save and Commit**
Save your changes to the workflow file and commit them to your repository.

4. **Test with a Sample PR**
Create a sample pull request and observe gitStream's behavior. It will use the configured self-hosted runners.

### Caching the Docker Image Using GitHub Cache

gitStream provides an optional method to control the frequency of Docker image downloads per day using GitHub's cache services, helping to manage build resources efficiently. By using the `update_times_a_day` argument, you can specify the number of times the Docker image should be downloaded and cached daily. If this argument is not specified, no caching will occur.
#### Configure Docker Image Caching

Add the `update_times_a_day` parameter to the `Evaluate Rules` step of your gitStream GitHub Actions workflow.
4. **Save and Commit**
- Save changes to the workflow file and commit them to your repository.

- **Open Your GitHub Actions Workflow File and Modify the `Evaluate Rules` Step:**
Navigate to your `.github/workflows` directory, open gitStream's workflow `yml`, and update the `Evaluate Rules` step. Add the `update_times_a_day` parameter to set the exact times the Docker image is downloaded and cached daily.

- **Example Configuration:**
Here is how you might configure the caching within your workflow:

```yaml
steps:
- name: Evaluate Rules
uses: linear-b/gitstream-github-action@v2
id: rules-engine
with:
full_repository: ${{ github.event.inputs.full_repository }}
head_ref: ${{ github.event.inputs.head_ref }}
base_ref: ${{ github.event.inputs.base_ref }}
client_payload: ${{ github.event.inputs.client_payload }}
installation_id: ${{ github.event.inputs.installation_id }}
resolver_url: ${{ github.event.inputs.resolver_url }}
resolver_token: ${{ github.event.inputs.resolver_token }}
update_times_a_day: 6
```
5. **Test with a Sample PR**
- Create a sample pull request to verify gitStream's behavior with self-hosted runners.

In this example, the Docker image is set to be downloaded and cached six times a day, distributed evenly across 24 hours (i.e., the image will be downloaded every 4 hours). This parameter can be adjusted to fit your workflow needs and resource management strategies. Without specifying this argument, no caching will be performed.

## Uninstalling gitStream

Expand Down

0 comments on commit 26e65d4

Please sign in to comment.