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

update the website when a branch is pushed #9

Merged
earl-warren merged 2 commits from pr-push-update-website into next 2023年08月16日 12:32:05 +02:00
Contributor
Copy link

TODO:

  • comment out the git push once the website has submodules merged in

Fixes: #8

Additionally

  • Upgrade to node:20

  • Exclude the README.md when copying to the preview

  • Allow forgejo-website to push to main on website

image

Preview: https://forgejo.codeberg.page/@docs_pull_9/

TODO: - [x] comment out the `git push` once the website has submodules merged in Fixes: https://codeberg.org/forgejo/docs/issues/8 Additionally * Upgrade to node:20 * Exclude the README.md when copying to the preview * Allow forgejo-website to push to main on website ![image](/attachments/14f4f38f-fdb8-4ca7-9aee-d9b7e108d71e) Preview: https://forgejo.codeberg.page/@docs_pull_9/
earl-warren force-pushed pr-push-update-website from da3577d91e
Some checks failed
push / publish (push) Failing after 2s
to 28667d7a68
Some checks failed
push / publish (push) Failing after 2s
2023年08月16日 08:15:25 +02:00
Compare
earl-warren force-pushed pr-push-update-website from 28667d7a68
Some checks failed
push / publish (push) Failing after 2s
to d158ab7a75
All checks were successful
push / publish (push) Successful in 3s
2023年08月16日 08:16:44 +02:00
Compare
Ghost approved these changes 2023年08月16日 08:52:39 +02:00
earl-warren force-pushed pr-push-update-website from d158ab7a75
All checks were successful
push / publish (push) Successful in 3s
to 88331cc723
Some checks failed
pr / preview (pull_request) Failing after 19s
2023年08月16日 11:33:28 +02:00
Compare
earl-warren force-pushed pr-push-update-website from 5c8aac2508
Some checks failed
pr / preview (pull_request) Failing after 5s
to 55016675a0
Some checks failed
pr / preview (pull_request) Failing after 5s
2023年08月16日 11:40:26 +02:00
Compare
earl-warren force-pushed pr-push-update-website from 55016675a0
Some checks failed
pr / preview (pull_request) Failing after 5s
to 61d98d8832
All checks were successful
pr / preview (pull_request) Successful in 37s
2023年08月16日 11:41:46 +02:00
Compare
earl-warren force-pushed pr-push-update-website from 6ef914fd36
All checks were successful
pr / preview (pull_request) Successful in 37s
to a5e234bb87
Some checks failed
push / publish (push) Failing after 5s
pr / preview (pull_request) Successful in 38s
2023年08月16日 11:48:37 +02:00
Compare
@ -17,2 +16,2 @@
mkdir -p /tmp/website/forgejo-docs/${{ env.GITHUB_BASE_REF }}
cp -a * /tmp/website/forgejo-docs/${{ env.GITHUB_BASE_REF }}
apt-get update -qq && apt-get install -qq -y rsync
rsync -av --exclude=README.md --delete ./ /tmp/website/forgejo-docs/${{ env.GITHUB_BASE_REF }}/
Member
Copy link

I don't think there should be any need to exclude README.md. The file layout in forgejo/website#331 was designed such that only the content of the docs and images subfolders will make it to the live website.

I don't think there should be any need to exclude `README.md`. The file layout in https://codeberg.org/forgejo/website/pulls/331 was designed such that only the content of the `docs` and `images` subfolders will make it to the live website.
Author
Contributor
Copy link

I prettyfied the README so it passes CI on the website

I prettyfied the README so it passes CI on the website
@ -0,0 +22,4 @@
git config user.email "ci@forgejo.org" ; git config user.name "forgejo-website"
git add .
git diff-index --quiet HEAD || git commit -m 'publish' -a
git push
Member
Copy link

For the actual publish we presumably need to push to Uberspace rather than to the Pages repo.

For the actual publish we presumably need to [push to Uberspace](https://codeberg.org/forgejo/website/src/commit/bc0c033989f2d6dfa810979bd298ee2002d543bc/.woodpecker.yml#L51-L62) rather than to the Pages repo.
Author
Contributor
Copy link

Here the push is to the website repo. Which will, in turn, publish to Uberspace.

Here the push is to the website repo. Which will, in turn, publish to Uberspace.
Author
Contributor
Copy link

It is cascading, the docs repository is not responsible for updating the website.

It is cascading, the docs repository is not responsible for updating the website.
Member
Copy link

Oh, sorry, I wasn't paying attention. Need more coffee!

But in that case I'm not sure about this approach – I don't think there's any need to commit to the website repo every time a change is made to the docs, that will just clutter the website history.
Wouldn't it be better to just trigger the website CI, which already pulls in the latest docs every time it's run?

Oh, sorry, I wasn't paying attention. Need more coffee! But in that case I'm not sure about this approach – I don't think there's any need to commit to the website repo every time a change is made to the docs, that will just clutter the website history. Wouldn't it be better to just trigger the website CI, which already pulls in the latest docs every time it's run?
Author
Contributor
Copy link

Wouldn't it be better to just trigger the website CI, which already pulls in the latest docs every time it's run?

I'm not sure how to do that.

that will just clutter the website history.

It will update the submodules which ensures consistency. Failing that the https://forgejo.org content will not match what someone gets when looking at git clone --recursive https://codeberg.org/forgejo/website because the submodules may be out of date.

> Wouldn't it be better to just trigger the website CI, which already pulls in the latest docs every time it's run? I'm not sure how to do that. > that will just clutter the website history. It will update the submodules which ensures consistency. Failing that the https://forgejo.org content will not match what someone gets when looking at `git clone --recursive https://codeberg.org/forgejo/website` because the submodules may be out of date.
Member
Copy link

I'm not sure how to do that.

Ah, well if you don't know, I'm sure I don't. I had "assumed" we could trigger that action via a webhook but I've no idea if that's true.

I guess an alternative would be to push straight to Uberspace – since we're building the whole website here for PRs anyway we could just do the same thing?

It will update the submodules which ensures consistency. Failing that the https://forgejo.org content will not match what someone gets when looking at git clone --recursive https://codeberg.org/forgejo/website because the submodules may be out of date.

I guess that's true – it doesn't affect the actual website because the CI pipeline already pulls the latest version, but it will affect local previews.

One workaround would be to just make the pnpm dev and pnpm build commands run git submodule update --remote first.

I still feel it would be much cleaner to avoid a load of commits just updating the submodule commit SHAs, but I can also understand the argument in favour, so in the end I'm happy to go with whatever others think is best here.

> I'm not sure how to do that. Ah, well if you don't know, I'm sure I don't. I had "assumed" we could trigger that action via a webhook but I've no idea if that's true. I guess an alternative would be to push straight to Uberspace – since we're building the whole website here for PRs anyway we could just do the same thing? > It will update the submodules which ensures consistency. Failing that the https://forgejo.org content will not match what someone gets when looking at git clone --recursive https://codeberg.org/forgejo/website because the submodules may be out of date. I guess that's true – it doesn't affect the actual website because the CI pipeline already pulls the latest version, but it will affect local previews. One workaround would be to just make the `pnpm dev` and `pnpm build` commands run `git submodule update --remote` first. I still feel it would be much cleaner to avoid a load of commits just updating the submodule commit SHAs, but I can also understand the argument in favour, so in the end I'm happy to go with whatever others think is best here.
Member
Copy link

One workaround would be to just make the pnpm dev and pnpm build commands run git submodule update --remote first.

Actually a cleaner solution would probably be to to it in a post-checkout hook.

> One workaround would be to just make the `pnpm dev` and `pnpm build` commands run `git submodule update --remote` first. Actually a cleaner solution would probably be to to it in a `post-checkout` hook.

This is an interesting idea. Never used those.

This is an interesting idea. Never used those.
@ -0,0 +1,48 @@
name:pr
Member
Copy link

Is this file supposed to be committed?

Is this file supposed to be committed?
Author
Contributor
Copy link

Good catch, I'll remove it.

Good catch, I'll remove it.
earl-warren marked this conversation as resolved
Member
Copy link

Unable to find current origin/v1.19 revision in submodule path 'forgejo-docs/v1.19'

That's a strange error 🤔

> Unable to find current origin/v1.19 revision in submodule path 'forgejo-docs/v1.19' That's a strange error 🤔
Author
Contributor
Copy link

I'm on it.

I'm on it.
earl-warren force-pushed pr-push-update-website from e5f9be2774
All checks were successful
pr / preview (pull_request) Successful in 37s
push / publish (push) Successful in 5s
to 8c4fb67823
Some checks failed
push / publish (push) Successful in 6s
pr / preview (pull_request) Failing after 22s
2023年08月16日 12:21:33 +02:00
Compare
Author
Contributor
Copy link
* A run that does not push because nothing https://codeberg.org/forgejo/docs/actions/runs/43 * A run that pushes a change https://codeberg.org/forgejo/docs/actions/runs/41
earl-warren force-pushed pr-push-update-website from 8c4fb67823
Some checks failed
push / publish (push) Successful in 6s
pr / preview (pull_request) Failing after 22s
to 9453ac7017
Some checks failed
pr / preview (pull_request) Failing after 22s
2023年08月16日 12:23:50 +02:00
Compare
make lint happy about the README.md
All checks were successful
pr / preview (pull_request) Successful in 38s
aa5e9fb0b1
Author
Contributor
Copy link

README.md fixed, should be good to go now.

README.md fixed, should be good to go now.
earl-warren deleted branch pr-push-update-website 2023年08月16日 12:32:05 +02:00
Author
Contributor
Copy link

I merged in haste because a test run broke the CI of the website.

I merged in haste because a test run broke the CI of the website.
Author
Contributor
Copy link
That fixed it https://forgejo-ci.codeberg.org/forgejo/website/pipeline/860
Sign in to join this conversation.
No reviewers
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
3 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!9
Reference in a new issue
forgejo/docs
No description provided.
Delete branch "pr-push-update-website"

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?