Skip to content
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
36 changes: 30 additions & 6 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build-upload-docs:
runs-on: ubuntu-latest
# Only one deployment at a time, otherwise the pushes to data.modm.io race.
# Only one deployment at a time, otherwise the pushes to data.modm.dev race.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
Expand All @@ -35,13 +35,13 @@ jobs:
make clone-sources-arm ext/stmicro/header/ ext/stmicro/cubehal/


- name: Clone modm-ext/data.modm.io repository
- name: Clone modm-ext/data.modm.dev repository
if: startsWith(github.ref, 'refs/heads/main')
uses: actions/checkout@v4
with:
repository: modm-ext/data.modm.io
ssh-key: ${{secrets.SSH_KEY_DATA_MODM_IO}}
path: docs/data.modm.io
repository: modm-ext/data.modm.dev
ssh-key: ${{secrets.SSH_KEY_DATA_MODM_DEV}}
path: docs/data.modm.dev


- name: Build Homepage
Expand All @@ -54,11 +54,35 @@ jobs:
run: |
git config --global user.email "bot@modm.io"
git config --global user.name "modm update bot"
cd docs/data.modm.io
cd docs/data.modm.dev
# The generated content replaces the repository wholesale, so rebase
# onto whatever is on the remote instead of merging into it.
git fetch origin main
git reset --soft origin/main
git add -A
git diff-index --quiet HEAD || git commit -m "Update"
git push origin main


# TODO: Remove once data.modm.io redirects to data.modm.dev
- name: Clone modm-ext/data.modm.io repository
if: startsWith(github.ref, 'refs/heads/main')
uses: actions/checkout@v4
with:
repository: modm-ext/data.modm.io
ssh-key: ${{secrets.SSH_KEY_DATA_MODM_IO}}
path: docs/data.modm.io


- name: Push New Docs to data.modm.io
if: startsWith(github.ref, 'refs/heads/main')
run: |
rm -rf docs/data.modm.io/docs
cp -r docs/data.modm.dev/docs docs/data.modm.io/docs
echo "data.modm.io" > docs/data.modm.io/docs/CNAME
cd docs/data.modm.io
git fetch origin main
git reset --soft origin/main
git add -A
git diff-index --quiet HEAD || git commit -m "Update"
git push origin main
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ src/pipeline/overview.md

# ignored since this is generated by mkdocs
data.modm.io/
data.modm.dev/
4 changes: 2 additions & 2 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
site_name: 'modm-data: Semantic Hardware Description'
site_description: 'Semantic Hardware Description'
site_author: 'Niklas Hauser'
site_url: 'https://data.modm.io'
site_url: 'https://data.modm.dev'

# Repository
repo_name: modm-io/modm-data
Expand All @@ -11,7 +11,7 @@ copyright: 'Copyright &copy 2022-<script>document.write(new Date().getFullYear()

# Turn around for GitHub Hosting in /docs
docs_dir: 'src'
site_dir: 'data.modm.io/docs'
site_dir: 'data.modm.dev/docs'
extra_css: []

theme:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
data.modm.io
data.modm.dev
4 changes: 2 additions & 2 deletions tools/make/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ format:
.PHONY: build-homepage
## Generate the entire homepage to /docs.
build-homepage:
@rm -rf docs/data.modm.io/docs/
@mkdir -p docs/data.modm.io/docs/
@rm -rf docs/data.modm.dev/docs/
@mkdir -p docs/data.modm.dev/docs/
@python3 tools/scripts/synchronize_docs.py
@pdoc --mermaid -o docs/src/api -t docs/pdoc modm_data
@modm_pinout --all -o docs/src/pinout/
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/synchronize_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def template(path_in, path_out, substitutions):
# remove html comments
readme = re.sub(r"((<!--webignore-->.*?<!--/webignore-->)|(<!--links-->.*?<!--/links-->))\n", "", readme, flags=re.DOTALL | re.MULTILINE)
readme = re.sub(r"<!--.*?-->", "", readme)
readme = readme.replace("https://data.modm.io", "")
readme = readme.replace("https://data.modm.io", "").replace("https://data.modm.dev", "")

template(index_in_path, index_path, {"content": readme, "links": links})
template(pipelines_in_path, pipelines_path, {"content": pipelines, "links": links})
Expand Down
Loading