FAForever / FAForever/fa

Split up the workflow action for better maintainability

Aperta
#6,397 0 commenti 0 reazioni 1 assegnatario Rivendicata da @relent0r Vedi su GitHub
area: changelog management
Lingua principale
Lua
Stelle
264
Fork
260
Merge medio
3g 2h
PR unite (30g)
21

Descrizione

### 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_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.