The publish workflow installed cloudron-surfer, the mkdocs pip set and @marp-team/marp-cli with no version pins, so a breaking or compromised upstream release would ship straight to the live site on the next merge to main. - pin cloudron-surfer@6.4.1, mkdocs==1.6.1, mkdocs-material==9.7.7, fontawesome_markdown==0.2.6, mkdocs-redirects==1.2.3 and @marp-team/marp-cli@4.5.1 (the versions the site builds with today) - add .npmrc with ignore-scripts=true and save-exact=true; neither npm package ships an install/preinstall/postinstall hook, so nothing is skipped
53 lines
1.8 KiB
YAML
53 lines
1.8 KiB
YAML
name: Publish to docs.datacontroller.io
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
name: Deploy docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
|
|
- name: Checkout master
|
|
uses: actions/checkout@v4 # Updated to latest version
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.12' # Specify your desired version (e.g., 3.10 or 3.12)
|
|
env:
|
|
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
|
|
RUNNER_TOOL_CACHE: /opt/hostedtoolcache
|
|
|
|
- name: Install Chrome
|
|
run: |
|
|
apt-get update
|
|
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
apt install -y ./google-chrome*.deb;
|
|
export CHROME_BIN=/usr/bin/google-chrome
|
|
|
|
# Deploy tooling is pinned to exact versions: the workflow builds whatever
|
|
# is committed, and an unpinned `latest` would let a breaking or
|
|
# compromised upstream release ship straight to the live site.
|
|
- name: Install Surfer
|
|
run: |
|
|
npm -g install cloudron-surfer@6.4.1
|
|
|
|
- name: build site
|
|
run: |
|
|
pip install mkdocs==1.6.1
|
|
pip install mkdocs-material==9.7.7
|
|
pip install fontawesome_markdown==0.2.6
|
|
pip install mkdocs-redirects==1.2.3
|
|
mkdocs build --clean
|
|
mkdir site/slides
|
|
npx @marp-team/marp-cli@4.5.1 slides/innovation/innovation.md -o ./site/slides/innovation/index.html
|
|
npx @marp-team/marp-cli@4.5.1 slides/if/if.md -o site/if.pdf --allow-local-files --html=true
|
|
- name: Deploy docs
|
|
run: surfer put --token ${{ secrets.SURFERKEY }} --server docs.datacontroller.io site/* /
|