Skip to content

Commit ad75bbb

Browse files
committed
Mirror primary repo to documentation repo
Set up a new GitHub Actions workflow to mirror the primary repository's master branch to the public documentation repository. This requires the use of a GitHub access token that has permission to read and write to both repositories (and create workflows). Note we do a full clone of the repository otherwise we can't force push all changes to the documentation repository. Now the documentation repository will only have a master branch, remove any references to the develop branch.
1 parent 3e97a89 commit ad75bbb

File tree

6 files changed

+27
-11
lines changed

6 files changed

+27
-11
lines changed

.github/workflows/mirror.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Mirror repository
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
mirror:
11+
runs-on: [self-hosted, web]
12+
steps:
13+
- uses: actions/checkout@v5
14+
with:
15+
ref: master
16+
token: ${{ secrets.DOCUMENTATION_REPO_TOKEN }}
17+
fetch-depth: 0
18+
- run: git remote add documentation https://github.com/raspberrypi/documentation.git
19+
- run: git push --force documentation master

CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ To contribute or update documentation:
1515

1616
1. Create a fork of this repository on your GitHub account.
1717

18-
1. Make changes in your fork. Start from the default `develop` branch.
18+
1. Make changes in your fork. Start from the default `master` branch.
1919

2020
1. Read our [style guide](https://github.com/raspberrypi/style-guide/blob/master/style-guide.md) to ensure that your changes are consistent with the rest of our documentation. Since Raspberry Pi is a British company, be sure to include all of your extra `u`s and transfigure those `z`s (pronounced 'zeds') into `s`s!
2121

2222
1. [Open a pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) against this repository.
2323

2424
1. The maintainers will assess and copy-edit the PR. This can take anywhere from a few minutes to a few days, depending on the size of your PR, the time of year, and the availability of the maintainers.
2525

26-
1. After making any requested improvements to your PR, the maintainers will accept the PR and merge your changes into `develop`.
27-
28-
1. When the maintainers next release the documentation by merging `develop` into `master`, your changes will go public on the production documentation site.
26+
1. After making any requested improvements to your PR, the maintainers will accept the PR and merge your changes into `master`, making them public on the production documentation site.
2927

3028
Alternatively, [open an issue](https://github.com/raspberrypi/documentation/issues) to discuss proposed changes.
3129

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div align="center">
22
<picture>
3-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/raspberrypi/documentation/refs/heads/develop/pi_dark.svg">
4-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/raspberrypi/documentation/refs/heads/develop/pi_light.svg">
3+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/raspberrypi/documentation/refs/heads/master/pi_dark.svg">
4+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/raspberrypi/documentation/refs/heads/master/pi_light.svg">
55
<img alt="Raspberry Pi: computers and microcontrollers"
6-
src="https://raw.githubusercontent.com/raspberrypi/documentation/refs/heads/develop/pi_light.svg"
6+
src="https://raw.githubusercontent.com/raspberrypi/documentation/refs/heads/master/pi_light.svg"
77
width="16%">
88
</picture>
99

@@ -19,4 +19,4 @@ This repository contains the source and tools used to build the [Raspberry Pi Do
1919

2020
## Licence
2121

22-
The Raspberry Pi documentation is [licensed](https://github.com/raspberrypi/documentation/blob/develop/LICENSE.md) under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA). Documentation tools (everything outside of the `documentation/` subdirectory) are licensed under the [BSD 3-Clause](https://opensource.org/licenses/BSD-3-Clause) licence.
22+
The Raspberry Pi documentation is [licensed](https://github.com/raspberrypi/documentation/blob/master/LICENSE.md) under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA). Documentation tools (everything outside of the `documentation/` subdirectory) are licensed under the [BSD 3-Clause](https://opensource.org/licenses/BSD-3-Clause) licence.

_config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ url: "https://www.raspberrypi.com/documentation" # the base hostname & protocol
2121
githuburl: "https://github.com/raspberrypi/documentation/"
2222
mainsite: https://raspberrypi.com/
2323
githubbranch: master
24-
githubbranch_edit: develop
2524

2625
# Build settings
2726
theme: minima

scripts/create_build_adoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def check_no_markdown(filename):
5454
with open(github_edit) as edit_fh:
5555
edit_template = edit_fh.read()
5656
template_vars = {
57-
'github_edit_link': os.path.join(site_config['githuburl'], 'blob', site_config['githubbranch_edit'], src_adoc)
57+
'github_edit_link': os.path.join(site_config['githuburl'], 'blob', site_config['githubbranch'], src_adoc)
5858
}
5959
edit_text = re.sub(r'{{\s*(\w+)\s*}}', lambda m: template_vars[m.group(1)], edit_template)
6060

scripts/create_build_adoc_include.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def check_no_markdown(filename):
3636
with open(github_edit) as edit_fh:
3737
edit_template = edit_fh.read()
3838
template_vars = {
39-
'github_edit_link': os.path.join(site_config['githuburl'], 'blob', site_config['githubbranch_edit'], src_adoc)
39+
'github_edit_link': os.path.join(site_config['githuburl'], 'blob', site_config['githubbranch'], src_adoc)
4040
}
4141
edit_text = re.sub(r'{{\s*(\w+)\s*}}', lambda m: template_vars[m.group(1)], edit_template)
4242

0 commit comments

Comments
 (0)