Skip to content

Commit f5a1fad

Browse files
authored
Merge pull request #2 from GoogleChrome/dadrian/site
Render site to Github pages
2 parents 5b9c732 + dfa4560 commit f5a1fad

21 files changed

+697
-40
lines changed

.github/workflows/pages.yaml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build and Deploy Site
2+
3+
# Controls when the workflow will run
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the "main" branch
6+
push:
7+
branches: [ "main" ]
8+
pull_request:
9+
branches: [ "main" ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains two jobs: "build" and "deploy"
17+
build:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
24+
- uses: actions/checkout@v4
25+
26+
# Install Python
27+
- name: Set up Python
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: '3.13.1' # Change this to your desired Python version
31+
cache: 'pipenv'
32+
33+
# Install pipenv
34+
- name: Install pipenv
35+
run: pip install --upgrade pipenv wheel
36+
37+
# Runs a single command using the runners shell
38+
- name: Build Site
39+
id: build
40+
env:
41+
GH_TOKEN: ${{ github.token }}
42+
run: |
43+
pipenv install
44+
url=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')
45+
echo $url
46+
pipenv run python src/generate.py --context base_url $url
47+
48+
# Upload site, does not deploy
49+
- name: Upload static files as artifact
50+
id: deployment
51+
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
52+
with:
53+
path: output_html/
54+
55+
# Deployment job
56+
deploy:
57+
needs: build
58+
59+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
60+
permissions:
61+
pages: write # to deploy to Pages
62+
id-token: write # to verify the deployment originates from an appropriate source
63+
environment:
64+
name: github-pages
65+
url: ${{ steps.deployment.outputs.page_url }}
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
output_html/

Pipfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
markdown = "*"
8+
jinja2 = "*"
9+
pyyaml = "*"
10+
11+
[dev-packages]
12+
13+
[requires]
14+
python_version = "3.13"
15+
python_full_version = "3.13.1"

Pipfile.lock

+167
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,17 @@ In Chrome 105, Chrome began a platform-by-platform transition from relying on th
99
The Chrome Root Program Policy establishes the minimum requirements for self-signed root CA certificates to be included as trusted in a default installation of Chrome. This GitHub repository contains a Markdown-formatted version of the authoritative version available [here](https://g.co/chrome/root-policy).
1010

1111
Any questions regarding the Chrome Root Program Policy can be directed to chrome-root-program [at] google [dot] com.
12+
13+
## Updating the Policy
14+
15+
The site is deployed on commits to `main`. To add a new policy revision:
16+
17+
- Archive the current version in `content/policy-archive/`.
18+
- Update `config.yaml`:
19+
- Update `context.versions` array so that the path for the now archived
20+
version is correct.
21+
- Add a new entry at the bottom of the array for the next version, with `path: /`
22+
- Bump `context.current_version` to the next version value
23+
- Update `content/index.md` with the new content.
24+
25+
This can all be done in a single pull request. The diff in the PR will show the diff between the two policy versions.

config.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
context:
2+
base_url: "http://localhost:8000"
3+
current_version: 1.6
4+
versions:
5+
- path: policy-archive/policy-version-1-0.html
6+
version: 1.0
7+
date: "2022-03-01"
8+
- path: policy-archive/policy-version-1-1.html
9+
version: 1.1
10+
date: "2022-06-01"
11+
- path: policy-archive/policy-version-1-2.html
12+
version: 1.2
13+
date: "2022-09-01"
14+
- path: policy-archive/policy-version-1-3.html
15+
version: 1.3
16+
date: "2023-01-06"
17+
- path: policy-archive/policy-version-1-4.html
18+
version: 1.4
19+
date: "2023-03-03"
20+
- path: policy-archive/policy-version-1-5.html
21+
version: 1.5
22+
date: "2024-01-16"
23+
- path: /
24+
version: 1.6
25+
date: "2025-02-15"
26+
input_dir: content
27+
template_dir: templates
28+
output_dir: output_html
File renamed without changes.

0 commit comments

Comments
 (0)