forgejo/docs
31
58
Fork
You've already forked docs
249

CI for docs updates and PRs #3

Closed
opened 2023年08月15日 16:46:56 +02:00 by caesar · 11 comments
Member
Copy link

Similar to the current forgejo/website repo, the CI should be run on commits to the next and version branches to publish to the live site, and previews should be generated for PRs.

We could probably just trigger the current website CI with a webhook from this repo, but it would need to post the preview comments here instead of there in the case of PRs to this repo.

Alternatively maybe it's a good time to switch to Forgejo Actions?

The CI is not my area of expertise so I'd love input from @dachary, @earl-warren, @crystal, and anyone else who wants to make any suggestions.

Similar to the current [forgejo/website](https://codeberg.org/forgejo/website) repo, the CI should be run on commits to the `next` and version branches to publish to the live site, and previews should be generated for PRs. We could probably just trigger the current website CI with a webhook from this repo, but it would need to post the preview comments here instead of there in the case of PRs to this repo. Alternatively maybe it's a good time to switch to Forgejo Actions? The CI is not my area of expertise so I'd love input from @dachary, @earl-warren, @crystal, and anyone else who wants to make any suggestions.

I have not spent much time with Forgejo Actions and I find the pipeline definitions somewhat confusing. Afaic Woodpecker works great and we can keep using it indefinitely. I won't object if others want to move things over.

For pull requests, we will need to get a little creative, since the docs depend upon the website sources to compile, we will need to clone the website repo and it's submodules, merge the pull request into the submodule for the target branch, compile it, and push the result to a preview branch in forgejo/pages.

As for rebuilding the production website when something gets merged, there are multiple approaches we could take. We could employ a similar strategy to the one outlined above, or we could simply make this repo's pipeline trigger a rebuild of the other repo's pipeline. It should be simple to do this with Woodpecker's API, but we will need to have an API token for Woodpecker as a secret.

I have not spent much time with Forgejo Actions and I find the pipeline definitions somewhat confusing. Afaic Woodpecker works great and we can keep using it indefinitely. I won't object if others want to move things over. For pull requests, we will need to get a little creative, since the docs depend upon the website sources to compile, we will need to clone the website repo and it's submodules, merge the pull request into the submodule for the target branch, compile it, and push the result to a preview branch in forgejo/pages. As for rebuilding the production website when something gets merged, there are multiple approaches we could take. We could employ a similar strategy to the one outlined above, or we could simply make this repo's pipeline trigger a rebuild of the other repo's pipeline. It should be simple to do this with Woodpecker's API, but we will need to have an API token for Woodpecker as a secret.
Contributor
Copy link

Afaic Woodpecker works great and we can keep using it indefinitely.

I disagree. It has been a lot of work to get it working and stable end of last year. I'm not eager to keep doing that on the long run.

> Afaic Woodpecker works great and we can keep using it indefinitely. I disagree. It has been a lot of work to get it working and stable end of last year. I'm not eager to keep doing that on the long run.

That's fair. I have been using upstream Woodpecker with the Gitea driver. I think you were doing good work on the Forgejo driver and I'm very disappointed that the Woodpecker maintainers flatly refused to merge it.

That's fair. I have been using upstream Woodpecker with the Gitea driver. I think you were doing good work on the Forgejo driver and I'm very disappointed that the Woodpecker maintainers flatly refused to merge it.
Contributor
Copy link

It turned out well in the end though: if I had been more involved in Woodpecker there would have been less energy spent on Forgejo Actions.

It turned out well in the end though: if I had been more involved in Woodpecker there would have been less energy spent on Forgejo Actions.
Contributor
Copy link

An issue was created Forgejo side to track the progress of having secrets in PRs. forgejo/forgejo#1278

An issue was created Forgejo side to track the progress of having secrets in PRs. https://codeberg.org/forgejo/forgejo/issues/1278
Author
Member
Copy link

The CI is working well for previews, but it doesn't generate a comment with the preview link. It would be great to add that. (I'm happy to try doing that later.)

The CI is working well for previews, but it doesn't generate a comment with the preview link. It would be great to add that. (I'm happy to try doing that later.)

Does the token have the issue:write scope required to post comments?

Does the token have the `issue:write` scope required to post comments?
Author
Member
Copy link

Does the token have the issue:write scope required to post comments?

Looks like it doesn't, so we'll have to generate a new token.

> Does the token have the `issue:write` scope required to post comments? Looks like it doesn't, so we'll have to generate a new token.

I re-created a token with the issue:write scope.

image

And replaced the WEBSITETOKEN secret with it in this repository

image

I re-created a token with the issue:write scope. ![image](/attachments/d516c994-9eeb-4a38-9285-e32f5165a15d) And [replaced the WEBSITETOKEN secret with it in this repository](https://codeberg.org/forgejo/docs/settings/actions/secrets) ![image](/attachments/040f337f-c46e-4d7a-9527-ec76723358fe)

Thanks for doing that @dachary . I think that's pretty much it for this issue, unless there's something I'm missing?

Thanks for doing that @dachary . I think that's pretty much it for this issue, unless there's something I'm missing?
Author
Member
Copy link

Thanks @dachary.
Yes, I think we can close this now.

Thanks @dachary. Yes, I think we can close this now.
Sign in to join this conversation.
No Branch/Tag specified
next
v16.0
v15.0
v11.0
bp-v15.0-c7697f2
actions-remove-non-existing-strategy-options
v14.0
v13.0
v12.0
v7.0
v10.0
v9.0
v8.0
v1.21
v1.20
v1.19
v13.0.0-dev
Labels
Clear labels
404
Broken links or missing content
backport/v1.19
Changes which should be backported to the v1.19 docs

Archived

backport/v1.20
Changes which should be backported to the v1.20 docs

Archived

backport/v1.21
Changes which should be backported to the v1.21 docs

Archived

backport/v10.0
Automated backport to v10.0

Archived

backport/v11.0
Automated backport to v11.0
backport/v12.0
Automated backport to v12.0

Archived

backport/v13.0
Automated backport to v13.0

Archived

backport/v14.0
Automated backport to v14.0

Archived

backport/v15.0
Automated backport to v15.0
backport/v16.0
Automated backport to v16.0
backport/v7.0
Automated backport to the v7.0 docs

Archived

backport/v8.0
Automated backport to the v8.0 docs

Archived

backport/v9.0
Automated backport to the v9.0 docs

Archived

good first issue
This issue is suitable for "drive-by contributors" wanting to contribute for the first time, and fixing it should be straightforward.
meta
Tooling and processes for maintaining the docs
new docs
Content to be added to the documentation

Archived

User research - Accessibility
Requires input about accessibility features, likely involves user testing.
User research - Blocked
Do not pick as-is! We are happy if you can help, but please coordinate with ongoing redesign in this area.
User research - Community
Community features, such as discovering other people's work or otherwise feeling welcome on a Forgejo instance.
User research - Config (instance)
Instance-wide configuration, authentication and other admin-only needs.
User research - Errors
How to deal with errors in the application and write helpful error messages.
User research - Filters
How filter and search is being worked with.
User research - Future backlog
The issue might be inspiring for future design work.
User research - Git workflow
AGit, fork-based and new Git workflow, PR creation etc
User research - Labels
Active research about Labels
User research - Moderation
Moderation Featuers for Admins are undergoing active User Research
User research - Needs input
Use this label to let the User Research team know their input is requested.
User research - Notifications/Dashboard
Research on how users should know what to do next.
User research - Rendering
Text rendering, markup languages etc
User research - Repo creation
Active research about the New Repo dialog.
User research - Repo units
The repo sections, disabling them and the "Add more" button.
User research - Security
User research - Settings (in-app)
How to structure in-app settings in the future?
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/docs#3
Reference in a new issue
forgejo/docs
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?