Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 522f313

Browse files
Add CI dev doc for in-house GitHub actions
This doc describes how we can reuse our in-house actions as our CI continues to grow. Signed-off-by: Courtney Pacheco <6019922+courtneypacheco@users.noreply.github.com>
1 parent c71e488 commit 522f313

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

docs/ci/ci-universal-actions.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Create Separate Repo for Custom GitHub Actions
2+
3+
## Idea Overview
4+
5+
Create a separate repository within the `instructlab` GitHub org to house our custom CI Github Actions.
6+
7+
## Motivation for this Proposal
8+
9+
Within our `instructlab` GitHub org, we have an in-house GitHub action that we use across several repos: `free-disk-space`.
10+
11+
Examples:
12+
- [eval's `free-disk-space`](https://github.com/instructlab/eval/blob/main/.github/actions/free-disk-space/action.yml)
13+
- [instructlab's `free-disk-space`](https://github.com/instructlab/instructlab/blob/main/.github/actions/free-disk-space/action.yml)
14+
- [sdg's `free-disk-space`](https://github.com/instructlab/sdg/blob/a532a8d99ffe447152948e9442464923aba62637/.github/actions/free-disk-space/action.yml)
15+
16+
This GitHub action is universal as it is a simple script used to clean up disk space on GitHub runners and can be modified to free disk space on our CentOS-based EC2 runners.
17+
18+
Note that all of these in-house `free-disk-space` action files are exactly the same, so we essentially have the same file stored in three different repos.
19+
20+
## Pros and Cons
21+
22+
Below are some pros and cons of creating a separate repository to house our GitHub actions.
23+
24+
### Pros
25+
26+
- We will have one action file in one location
27+
- Easier to make changes in one location instead of (our present) three locations
28+
- Contributors will know where to look for in-house action files
29+
- We can create releases and utilize version control
30+
31+
### Cons
32+
33+
- Extra repository to maintain.
34+
- We can't publish any of our actions to the GitHub marketplace if we have multiple actions stored in one repository.\*
35+
36+
\* In reference to the last bullet point, [the GitHub docs for publishing Actions](https://docs.github.com/en/actions/sharing-automations/creating-actions/publishing-actions-in-github-marketplace#about-publishing-actions) states:
37+
> Actions are published to GitHub Marketplace immediately and aren't reviewed by GitHub as long as they meet these requirements:
38+
>
39+
> - The action must be in a public repository.
40+
> - Each repository must contain a single action.
41+
42+
If we do care about publishing our actions, then we should consider creating separate repositories for these actions. If we don't care to publish, then this is a non-issue. (See next section below.)
43+
44+
## Additional Info
45+
46+
Even if we cannot publish our actions to the GitHub marketplace, we can _still_ use these actions in our repository. For example, if our repo was named `ci-actions` with this layout:
47+
48+
```
49+
.
50+
├── custom-action-1/
51+
│ ├── action.yml
52+
├── custom-action-2
53+
│ ├── action.yml
54+
```
55+
56+
...then we'd reference them in our other repos like so:
57+
58+
```
59+
name: Some Name
60+
61+
on:
62+
workflow_dispatch:
63+
64+
jobs:
65+
some-job:
66+
runs-on: ubuntu-latest
67+
68+
steps:
69+
- name: Checkout code
70+
uses: actions/checkout
71+
72+
- name: Use custom action 1
73+
uses: instructlab/ci-actions/custom-action-1@main
74+
75+
- name: Use custom action 2
76+
uses: instructlab/ci-actions/custom-action-2@main
77+
```
78+
79+
Reference: https://stackoverflow.com/a/79100136

0 commit comments

Comments
 (0)