Skip to content

Render site to Github pages #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build and Deploy Site

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains two jobs: "build" and "deploy"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

# Install Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13.1' # Change this to your desired Python version
cache: 'pipenv'

# Install pipenv
- name: Install pipenv
run: pip install --upgrade pipenv wheel

# Runs a single command using the runners shell
- name: Build Site
id: build
env:
GH_TOKEN: ${{ github.token }}
run: |
pipenv install
url=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')
echo $url
pipenv run python src/generate.py --context base_url $url

# Upload site, does not deploy
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
with:
path: output_html/

# Deployment job
deploy:
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
output_html/
15 changes: 15 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
markdown = "*"
jinja2 = "*"
pyyaml = "*"

[dev-packages]

[requires]
python_version = "3.13"
python_full_version = "3.13.1"
167 changes: 167 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,17 @@ In Chrome 105, Chrome began a platform-by-platform transition from relying on th
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).

Any questions regarding the Chrome Root Program Policy can be directed to chrome-root-program [at] google [dot] com.

## Updating the Policy

The site is deployed on commits to `main`. To add a new policy revision:

- Archive the current version in `content/policy-archive/`.
- Update `config.yaml`:
- Update `context.versions` array so that the path for the now archived
version is correct.
- Add a new entry at the bottom of the array for the next version, with `path: /`
- Bump `context.current_version` to the next version value
- Update `content/index.md` with the new content.

This can all be done in a single pull request. The diff in the PR will show the diff between the two policy versions.
28 changes: 28 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
context:
base_url: "http://localhost:8000"
current_version: 1.6
versions:
- path: policy-archive/policy-version-1-0.html
version: 1.0
date: "2022-03-01"
- path: policy-archive/policy-version-1-1.html
version: 1.1
date: "2022-06-01"
- path: policy-archive/policy-version-1-2.html
version: 1.2
date: "2022-09-01"
- path: policy-archive/policy-version-1-3.html
version: 1.3
date: "2023-01-06"
- path: policy-archive/policy-version-1-4.html
version: 1.4
date: "2023-03-03"
- path: policy-archive/policy-version-1-5.html
version: 1.5
date: "2024-01-16"
- path: /
version: 1.6
date: "2025-02-15"
input_dir: content
template_dir: templates
output_dir: output_html
File renamed without changes.
Loading
Loading