Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

ci(docs): deploy main's docs to v7.invoke.ai

Lincoln Steina6b0ff66fccc
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
index 88ace849ea..62012aabab 100644
--- a/.github/workflows/deploy-docs.yml
+++ b/.github/workflows/deploy-docs.yml
@@ -9,15 +9,8 @@ on:
- 'ready_for_review'
- 'opened'
- 'synchronize'
+ # main deploys to v7.invoke.ai (invoke-ai/docs-v7); invoke.ai is deployed from the v6-bugfixes branch.
workflow_dispatch:
- inputs:
- deploy_target:
- description: 'Deploy target (custom = invoke.ai, ghpages = invoke-ai.github.io/InvokeAI)'
- type: choice
- options:
- - custom
- - ghpages
- default: custom
permissions:
contents: read
@@ -38,13 +31,15 @@ jobs:
with:
fetch-depth: 0
- - name: mark manual run
- if: github.event_name == 'workflow_dispatch'
+ # Deploy-branch pushes always rebuild: with cancel-in-progress, a later push that skipped
+ # the build would cancel an earlier docs push's deploy and leave its changes unpublished.
+ - name: mark push or manual run
+ if: github.event_name != 'pull_request'
id: manual
run: echo "docs=true" >> "$GITHUB_OUTPUT"
- name: detect docs-related changes
- if: github.event_name != 'workflow_dispatch'
+ if: github.event_name == 'pull_request'
id: filter
uses: dorny/paths-filter@v3
with:
@@ -119,35 +114,62 @@ jobs:
run: pnpm build
working-directory: docs
env:
- DEPLOY_TARGET: ${{ github.event_name == 'workflow_dispatch' && inputs.deploy_target || 'custom' }}
- ENABLE_ANALYTICS: ${{ github.ref == 'refs/heads/main' && (github.event_name != 'workflow_dispatch' || inputs.deploy_target == 'custom') }}
+ DEPLOY_TARGET: custom
+ ENABLE_ANALYTICS: ${{ github.ref == 'refs/heads/main' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: verify deploy output
run: pnpm run check-deploy-output
working-directory: docs
env:
- DEPLOY_TARGET: ${{ github.event_name == 'workflow_dispatch' && inputs.deploy_target || 'custom' }}
+ DEPLOY_TARGET: custom
# Upload artifact for deploy (main branch only)
- - name: upload pages artifact
+ - name: upload site artifact
if: github.ref == 'refs/heads/main'
- uses: actions/upload-pages-artifact@v5
+ uses: actions/upload-artifact@v7
with:
+ name: docs-site
path: docs/dist
+ include-hidden-files: true
+ retention-days: 1
+ # GitHub Pages serves one custom domain per repository, and this repository's is invoke.ai (v6),
+ # so the v7 site is published to the gh-pages branch of invoke-ai/docs-v7 with a deploy key.
deploy:
if: github.ref == 'refs/heads/main'
needs: check-and-build
runs-on: ubuntu-latest
permissions:
contents: read
- pages: write
- id-token: write
environment:
- name: github-pages
- url: ${{ steps.deployment.outputs.page_url }}
+ name: docs-v7
+ url: https://v7.invoke.ai
steps:
- - name: deploy to GitHub Pages
- id: deployment
- uses: actions/deploy-pages@v5
+ - name: download site artifact
+ uses: actions/download-artifact@v8
+ with:
+ name: docs-site
+ path: site
+
+ - name: publish to invoke-ai/docs-v7
+ env:
+ DEPLOY_KEY: ${{ secrets.DOCS_V7_DEPLOY_KEY }}
+ GH_TOKEN: ${{ github.token }}
+ working-directory: site
+ run: |
+ set -euo pipefail
+ # The custom domain comes from CNAME; .nojekyll keeps branch-based Pages from dropping _astro/.
+ test "$(cat CNAME)" = "v7.invoke.ai"
+ touch .nojekyll
+
+ mkdir -p ~/.ssh
+ gh api meta --jq '.ssh_keys[] | "github.com " + .' > ~/.ssh/known_hosts
+ eval "$(ssh-agent -s)"
+ ssh-add - <<< "$DEPLOY_KEY"
+
+ git init -q -b gh-pages
+ git add -A
+ git -c user.name='github-actions[bot]' -c user.email='41898282+github-actions[bot]@users.noreply.github.com' \
+ commit -q -m "Deploy invoke-ai/InvokeAI@${GITHUB_SHA}"
+ git push --force [email protected]:invoke-ai/docs-v7.git gh-pages
diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs
index 402e590adc..1bff499fe1 100644
--- a/docs/astro.config.mjs
+++ b/docs/astro.config.mjs
@@ -19,14 +19,14 @@ import {
socialConfig,
} from './src/config';
-// Deployment target: 'custom' (default, custom domain at invoke.ai) or 'ghpages'
+// Deployment target: 'custom' (default, custom domain at v7.invoke.ai) or 'ghpages'
// (GitHub Pages project URL at invoke-ai.github.io/InvokeAI). Drive site/base from this
// so the same source can be deployed to either target.
const deployTarget = process.env.DEPLOY_TARGET ?? 'custom';
const isGhPages = deployTarget === 'ghpages';
const enableAnalytics = process.env.ENABLE_ANALYTICS === 'true';
const base = isGhPages ? '/InvokeAI' : '';
-const site = isGhPages ? 'https://invoke-ai.github.io' : 'https://invoke.ai';
+const site = isGhPages ? 'https://invoke-ai.github.io' : 'https://v7.invoke.ai';
const redirects = createRedirects(base);
const head = createHeadConfig({ base, enableAnalytics, isGhPages, site });
diff --git a/docs/public/CNAME b/docs/public/CNAME
index 91547b2904..82175153b1 100644
--- a/docs/public/CNAME
+++ b/docs/public/CNAME
@@ -1 +1 @@
-invoke.ai
+v7.invoke.ai
diff --git a/docs/src/content/docs/development/Documentation/index.mdx b/docs/src/content/docs/development/Documentation/index.mdx
index 6a050ac4e2..4c1af95c12 100644
--- a/docs/src/content/docs/development/Documentation/index.mdx
+++ b/docs/src/content/docs/development/Documentation/index.mdx
@@ -257,7 +257,7 @@ Just like with the dev environment, you can build the docs one of two ways:
And that's it.
:::tip[Deploy Target]
- The make command here sets the `DEPLOY_TARGET` environment variable to `custom`, so that the final output matches what you'd expect from the final deployment to https://invoke.ai.
+ The make command here sets the `DEPLOY_TARGET` environment variable to `custom`, so that the final output matches what you'd expect from the final deployment to https://v7.invoke.ai.
If you'd rather set a different deploy target, use the manual method.
:::
@@ -311,7 +311,7 @@ The docs contain tests for the following:
Once you've submitted your updated docs, either via pull request or a main push to your own fork, the `deploy-docs` action will run.
-The `deploy-docs` action will install the necessary dependencies, run a build, test and serve the docs on github pages. Any failing deployments will require fixing before deploying.
+The `deploy-docs` action will install the necessary dependencies, run a build and test it. Pushes to `main` then publish the site to https://v7.invoke.ai, served by GitHub Pages from the `invoke-ai/docs-v7` repository. The v6 documentation at https://invoke.ai is built and deployed from the `v6-bugfixes` branch. Any failing deployments will require fixing before deploying.
## Troubleshooting