FAForever / FAForever/fa

Split up the workflow action for better maintainability

Open
#6,397 0 comments 0 reactions 1 assignee Claimed by @relent0r View on GitHub
area: changelog management
Dominant language
Lua
Stars
264
Forks
260
Avg merge
3d 2h
Merged PRs (30d)
21

Description

### Description

At the moment we're introducing pre-processing steps to the [build and deploy](https://github.com/FAForever/fa/blob/develop/.github/workflows/docs-build.yml) workflow. In the future we'll be introducing various other pre-processing and possibly even post-processing steps. This can quickly turn into a mess: one workflow file that will have more and more responsibilities.

To get in front of this it is best to split off the [build and deploy](https://github.com/FAForever/fa/blob/develop/.github/workflows/docs-build.yml) workflow file into two workflow files:

- (1) A workflow file that retrieves the repository and applies the pre-processing. It returns the `docs` folder as an artifact.
- (2) A workflow file that takes the `docs` artifact and then proceeds to build and deploy it.

The advantage of this approach is that we can review what it is that we end up building by downloading the artifact manually. This should make it easier to review the pre-processing without building and deploying the entire webapp.

### Course of Action

Review the current [build and deploy](https://github.com/FAForever/fa/blob/develop/.github/workflows/docs-build.yml) workflow. Split off the following parts of it into a separate, new workflow called `docs-prepare-build.yml`:

- (1) Checkout of the repository
- (2) Creation of changelogs for fafdevelop and fafbeta
- (3) Appending of changelogs to whatever is in the `docs` folder
- (4) pre-processing all the changelogs to update github references

Then, we want to create a new artifact of the whatever the content is of the `docs` folder. We call the artifact `docs`.

In the current [build and deploy](https://github.com/FAForever/fa/blob/develop/.github/workflows/docs-build.yml) workflow we want to add an extra step calling the `docs-prepare-build.yml` workflow. Then, instead of checking out the repository we retrieve the `docs` artifact. After that we proceed with building and deploying whatever is in the `docs` artifact.

tip: don't forget to add the workflow that we need to wait on to the `needs` key-value pair!

### Test Plan

Once the skeleton is in-place you should be able to run the workflow from your branch and inspect the artifact of the pre-processed `docs` folder.

### Learning Goals

Long-term maintainability should always be part of the development process. With these changes we not only reduce the responsibilities of the [build and deploy](https://github.com/FAForever/fa/blob/develop/.github/workflows/docs-build.yml), we also introduce the capability to inspect what we end up building, before building (and deploying) it.

### Progress

_Not applicable_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.