Skip to content

Commit

Permalink
ci(docs): Publish to, serve from docs branch (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
setu4993 authored Jun 5, 2024
1 parent 1b3aa27 commit 3bd05f6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ site_name: Galileo Protect

nav:
- Galileo Protect Reference: index.md
- Galileo Docs: https://docs.rungalileo.io/

theme:
name: material
Expand All @@ -23,6 +24,7 @@ theme:
primary: deep purple
accent: purple
copyright: Copyright © 2024 Galileo Technologies, Inc.
remote_branch: docs
extra:
generator: false

Expand Down
2 changes: 1 addition & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 3bd05f6

Please sign in to comment.