From 3bd05f62e8333e6f3e9badf54e86618c22c42001 Mon Sep 17 00:00:00 2001 From: Setu Shah Date: Wed, 5 Jun 2024 11:07:40 -0700 Subject: [PATCH] ci(docs): Publish to, serve from `docs` branch (#56) --- .github/workflows/publish-docs.yaml | 32 ++++++++++++++--------------- mkdocs.yml | 2 ++ tasks.py | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml index 1cf478b..79ae987 100644 --- a/.github/workflows/publish-docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -14,6 +14,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GALILEO_AUTOMATION_GITHUB_TOKEN }} - name: Install poetry run: pipx install poetry==${{ vars.POETRY_VERSION }} @@ -31,21 +34,16 @@ jobs: pipx install invoke poetry install --all-extras --without test,dev - - name: Build Docs - run: invoke docs-build - - - name: Add GitHub Pages Config + - name: Setup Git Config with SSH Signing Key run: | - touch site/.nojekyll - - - name: Pushes to another repository - uses: cpina/github-action-push-to-another-repository@main - env: - SSH_DEPLOY_KEY: ${{ secrets.SSH_PROTECT_DOCS_DEPLOY_KEY }} - with: - source-directory: "site/" - target-directory: "docs/" - destination-github-username: "rungalileo" - destination-repository-name: "protect-docs" - user-name: galileo-automation - user-email: ci@rungalileo.io + mkdir -vp ~/.ssh + echo -e "${{ secrets.GALILEO_AUTOMATION_SSH_PUBLIC_KEY }}" >>~/.ssh/signing_key.pub + echo -e "${{ secrets.GALILEO_AUTOMATION_SSH_PRIVATE_KEY }}" >>~/.ssh/signing_key + git config --global gpg.format ssh + git config --global user.signingKey ~/.ssh/signing_key + git config --global commit.gpgsign true + git config --global user.email ci@rungalileo.io + git config --global user.name "galileo-automation" + + - name: Build and Deploy Docs + run: poetry run mkdocs gh-deploy diff --git a/mkdocs.yml b/mkdocs.yml index 14af086..2ed264b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -2,6 +2,7 @@ site_name: Galileo Protect nav: - Galileo Protect Reference: index.md + - Galileo Docs: https://docs.rungalileo.io/ theme: name: material @@ -23,6 +24,7 @@ theme: primary: deep purple accent: purple copyright: Copyright © 2024 Galileo Technologies, Inc. +remote_branch: docs extra: generator: false diff --git a/tasks.py b/tasks.py index 102974d..d9ac1ff 100644 --- a/tasks.py +++ b/tasks.py @@ -27,5 +27,5 @@ def type_check(ctx: Context) -> None: @task -def docs_build(ctx: Context) -> None: +def docs_local_build(ctx: Context) -> None: ctx.run("poetry run mkdocs build", echo=True)