diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index e55d694..bc62a95 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -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' }} @@ -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 @@ -54,7 +54,7 @@ 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 @@ -62,3 +62,27 @@ jobs: 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 diff --git a/docs/.gitignore b/docs/.gitignore index c81190d..905ad09 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -9,3 +9,4 @@ src/pipeline/overview.md # ignored since this is generated by mkdocs data.modm.io/ +data.modm.dev/ diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 68a7c45..d95e8f7 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -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 @@ -11,7 +11,7 @@ copyright: 'Copyright © 2022-