Skip to content

Commit 1435d5d

Browse files
authored
Merge pull request #263 from raspberrypi/develop
Deploy to production
2 parents 629da6d + b8e1912 commit 1435d5d

File tree

7 files changed

+95
-29
lines changed

7 files changed

+95
-29
lines changed

.github/workflows/build.yml

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
name: Build
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- master
8+
- develop
79
pull_request:
810

911
jobs:
1012
build:
11-
runs-on: ubuntu-latest
13+
runs-on: [self-hosted, web]
1214
steps:
13-
- name: Only allow pull requests based on master from the develop branch of the current repository
14-
if: ${{ github.base_ref == 'master' && !(github.head_ref == 'develop' && github.event.pull_request.head.repo.full_name == github.repository) }}
15-
run: |
16-
echo "Pull requests based on master can only come from the develop branch of this repository"
17-
echo "Please check your base branch as it should be develop by default"
18-
exit 1
1915
- uses: actions/checkout@v5
2016
- uses: actions/setup-python@v6
2117
with:
@@ -42,15 +38,58 @@ jobs:
4238
run: make build_doxygen_adoc
4339
- name: Build documentation
4440
run: make -j 2
41+
- uses: actions/upload-artifact@v4
42+
with:
43+
name: documentation
44+
path: documentation/html/
45+
if-no-files-found: error
46+
retention-days: 1
47+
include-hidden-files: true
48+
49+
deploy-staging:
50+
needs: build
51+
runs-on: ubuntu-latest
52+
environment:
53+
name: staging
54+
url: ${{ vars.STAGING_URL }}
55+
if: ${{ github.ref == 'refs/heads/develop' }}
56+
steps:
57+
- uses: actions/checkout@v5
58+
- uses: actions/download-artifact@v5
59+
with:
60+
name: documentation
61+
path: documentation/html
62+
- name: Deploy to Mythic Beasts
63+
uses: ./.github/actions/deploy-action
64+
with:
65+
private_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }}
66+
public_bastion_host_keys: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
67+
bastion_host: ${{ secrets.DEPLOY_BASTION_HOST }}
68+
primary_host: ${{ secrets.DEPLOY_PRIMARY_HOST }}
69+
secondary_host: ${{ secrets.DEPLOY_SECONDARY_HOST }}
70+
source: documentation/html/
71+
destination: documentation
72+
73+
deploy-production:
74+
needs: build
75+
runs-on: ubuntu-latest
76+
environment:
77+
name: production
78+
url: ${{ vars.PRODUCTION_URL }}
79+
if: ${{ github.ref == 'refs/heads/master' }}
80+
steps:
81+
- uses: actions/checkout@v5
82+
- uses: actions/download-artifact@v5
83+
with:
84+
name: documentation
85+
path: documentation/html
4586
- name: Deploy to Mythic Beasts
46-
if: ${{ github.ref == 'refs/heads/master' }}
4787
uses: ./.github/actions/deploy-action
4888
with:
4989
private_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }}
5090
public_bastion_host_keys: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
5191
bastion_host: ${{ secrets.DEPLOY_BASTION_HOST }}
5292
primary_host: ${{ secrets.DEPLOY_PRIMARY_HOST }}
5393
secondary_host: ${{ secrets.DEPLOY_SECONDARY_HOST }}
54-
# this needs to match destination: in _config.yml
5594
source: documentation/html/
5695
destination: documentation

.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: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,45 @@
11
# Contributing to the Raspberry Pi Documentation
22

3-
The Raspberry Pi Documentation website is built from Asciidoc source using:
3+
Welcome to the [public repository](https://github.com/raspberrypi/documentation/) for the Raspberry Pi documentation. This repository contains the Asciidoc source and the Jekyll-based build tools for the HTML documentation hosted at the [Raspberry Pi documentation site](https://www.raspberrypi.com/documentation/).
44

5-
* [Asciidoctor](https://asciidoctor.org/)
6-
* [Jekyll](https://jekyllrb.com/)
7-
* [jekyll-asciidoc](https://github.com/asciidoctor/jekyll-asciidoc)
8-
* Python
5+
The public repository is a mirror of an internal repository from which the site is built. The master branch of this repository is automatically kept up to date with the latest published content on the [website](https://www.raspberrypi.com/documentation/).
96

10-
The website automatically deploys to [www.raspberrypi.com/documentation](https://www.raspberrypi.com/documentation) using GitHub Actions when new commits appear in the `master` branch.
7+
We encourage and value all types of contributions from our community. Please make sure to read the following section before making your contribution. It makes it a lot easier for the Raspberry Pi Technical Documentation team (the maintainers) and smooths out the experience for all involved. We look forward to your contributions.
118

129
## Contribute
1310

14-
To contribute or update documentation:
11+
To suggest changes to this documentation:
1512

16-
1. Create a fork of this repository on your GitHub account.
13+
1. Create a fork of the `raspberrypi/documentation` repository on your GitHub account.
1714

18-
1. Make changes in your fork. Start from the default `develop` branch.
15+
1. Make changes in your fork. Start by branching from the default `master` branch.
1916

2017
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!
2118

2219
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.
2320

24-
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.
21+
1. The maintainers assess the PR. We hope to get back to you within a fortnight, but this might vary depending on the size of your PR, the time of year, and the availability of the maintainers.
2522

26-
1. After making any requested improvements to your PR, the maintainers will accept the PR and merge your changes into `develop`.
23+
1. What happens next depends on the content of the PR and whether it inspires any wider changes:
2724

28-
1. When the maintainers next release the documentation by merging `develop` into `master`, your changes will go public on the production documentation site.
25+
* If we have questions about the PR, we work with you to understand what you are going for and how best the docs can achieve it.
26+
* If your PR can be included as-is, we use the patch mechanism to bring it across to the internal repository and commit it there. When the change is published on the Raspberry Pi Documentation website, it is mirrored to the public repository and your PR closes automatically.
27+
* If your PR needs significant editing or prompts a wider change to the documentation, we take on that work in our internal repository. We'll let you know if that's the case and how long we expect it to take.
28+
If we don't bring your initial changes over as a patch, we use the [co-author mechanism](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors) to ensure you get credit for your contribution.
2929

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

3232
## Build
3333

34+
The Raspberry Pi Documentation website is built from Asciidoc source using:
35+
36+
* [Asciidoctor](https://asciidoctor.org/)
37+
* [Jekyll](https://jekyllrb.com/)
38+
* [jekyll-asciidoc](https://github.com/asciidoctor/jekyll-asciidoc)
39+
* Python
40+
41+
The website deploys to [www.raspberrypi.com/documentation](https://www.raspberrypi.com/documentation) from an internal repository that is mirrored to the [public repository](https://github.com/raspberrypi/documentation/).
42+
3443
### Install dependencies
3544

3645
To build the Raspberry Pi documentation locally, you'll need Ruby, Python, and the Ninja build system.
@@ -54,7 +63,7 @@ Close and re-launch your terminal window to use the new dependencies and configu
5463

5564
#### macOS
5665

57-
If you don't already have it, we recommend installing the [Homebrew](https://brew.sh/) package manager:
66+
If you don't already have it, we recommend installing the [Homebrew](https://brew.sh/) package manager:
5867

5968
```console
6069
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

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)