Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workflows to use actions that don't need organization secrets #1571

Merged

Conversation

jdbaldry
Copy link
Member

PR Description

Each repository can only have 100 organization secrets and there are now more than 100 in our organization which causes inconsitent behavior.

Some repositories don't have the secrets they need assigned.

These composite actions use secrets stored in Vault that are available to all repositories.

Which issue(s) this PR fixes

Closes https://github.com/grafana/technical-documentation/issues/969

Notes to the Reviewer

There is some copy-paste involved in the creation of these workflows. Please check:

For publish-technical-documentation-next.yml:

  • The on.push branches and paths filters are correct for your repository.
  • The jobs.sync.if repository matches your repository.
  • The jobs.sync.steps[1].with.website_directory matches the directory you publish to in the website repository.

For publish-technical-documentation-release.yml:

  • The on.push branches, tags, and paths filters are correct for your repository.
  • The jobs.sync.if repository matches your repository.
  • The jobs.sync.steps[1].with.release_tag_regexp regular expression matches your tags and captures major, minor, and patch versions from those tags.
  • The jobs.sync.steps[1].with.release_branch_regexp regular expression matches your release branch names and captures major and minor versions from those branch names.
  • The jobs.sync.steps[1].with.release_branch_with_patch_regexp regular expression matches your release branch names if they were to include a patch version, and that it would capture major, minor, and patch versions from those branch names.
  • The jobs.sync.steps[1].with.website_directory matches the directory you publish to in the website repository.

Each repository can only have 100 organization secrets and there are now more than 100 in our organization which causes inconsitent behavior.

Some repositories don't have the secrets they need assigned.

These composite actions use secrets stored in Vault that are available to all repositories.

- `publish-technical-documentation-next.yml` has been tested with https://github.com/grafana/writers-toolkit/blob/main/.github/workflows/publish-technical-documentation.yml.
- `publish-technical-documentation-release.yml` has been tested with https://github.com/grafana/backend-enterprise/blob/gem-release-2.13/.github/workflows/publish-technical-documentation-release.yml.

There is some copy-paste involved in the creation of these workflows. Please check:

For `publish-technical-documentation-next.yml`:

- [ ] The `on.push` `branches` and `paths` filters are correct for your repository.
- [ ] The `jobs.sync.if` repository matches your repository.
- [ ] The `jobs.sync.steps[1].with.website_directory` matches the directory you publish to in the website repository.

For `publish-technical-documentation-release.yml`:

- [ ] The `on.push` `branches`, `tags`, and `paths` filters are correct for your repository.
- [ ] The `jobs.sync.if` repository matches your repository.
- [ ] The `jobs.sync.steps[1].with.release_tag_regexp` regular expression matches your tags and captures major, minor, and patch versions from those tags.
- [ ] The `jobs.sync.steps[1].with.release_branch_regexp` regular expression matches your release branch names and captures major and minor versions from those branch names.
- [ ] The `jobs.sync.steps[1].with.release_branch_with_patch_regexp` regular expression matches your release branch names if they were to include a patch version, and that it would capture major, minor, and patch versions from those branch names.
- [ ] The `jobs.sync.steps[1].with.website_directory` matches the directory you publish to in the website repository.

Signed-off-by: Jack Baldry <[email protected]>
@ptodev ptodev self-assigned this Sep 20, 2024
Comment on lines +28 to +29
website_directory: content/docs/alloy
version_suffix: ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this will update both content/docs/alloy/latest and, for example, content/docs/alloy/v1.2/ ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, late reply.

Short answer: yes.

Longer answer:

We actually publish only version directories and then the website derives "latest" from the highest published version directory. So content/docs/alloy/latest doesn't actually get updated but /docs/alloy/latest/ does.

@jdbaldry jdbaldry merged commit b013bc5 into main Oct 10, 2024
18 checks passed
@jdbaldry jdbaldry deleted the jdb/2024-08-update-publish-workflows-to-avoid-org-secrets branch October 10, 2024 13:11
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants