diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index e4b95ee8..dc1412df 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -167,10 +167,10 @@ jobs: steps: - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b - uses: docker://docker.io/nixos/nix@sha256:1d13ae379fb8caf3f859c5ce7ec6002643d60cf8b7b6147b949cc34880c93bac - name: /docs/gh-deploy + name: /docs/deploy with: set-safe-directory: /github/workspace - args: sh -c "nix-env -if . && m . /docs gh-deploy --force --no-history" + args: sh -c "nix-env -if . && m . /docs/deploy prod" env: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} diff --git a/README.md b/README.md index b12eb786..ddfaaeaa 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,11 @@ It is ## Installation -[Installation](https://fluidattacks.github.io/makes/#installation) +[Installation](https://makes.fluidattacks.com/getting-started/#installation) ## Documentation -See https://fluidattacks.github.io/makes/ +See https://makes.fluidattacks.com ## Issues diff --git a/docs/.gitignore b/docs/.gitignore index c9490a53..2fa3f6a4 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1 +1,2 @@ /site +/src/CNAME diff --git a/docs/mkdocs.yaml b/docs/mkdocs.yaml index d1b22707..c8f2d285 100644 --- a/docs/mkdocs.yaml +++ b/docs/mkdocs.yaml @@ -1,5 +1,5 @@ site_name: Makes -site_url: https://fluidattacks.github.io/makes/ +site_url: https://makes.fluidattacks.com/ site_description: Documentation for Makes site_author: Fluid Attacks repo_url: https://github.com/fluidattacks/makes diff --git a/makes/docs/deploy/entrypoint.sh b/makes/docs/deploy/entrypoint.sh new file mode 100644 index 00000000..beceb6d7 --- /dev/null +++ b/makes/docs/deploy/entrypoint.sh @@ -0,0 +1,17 @@ +# shellcheck shell=bash + +function main { + local env="${1:-}" + local domain="makes.fluidattacks.com" + local cname_path="src/CNAME" + + : \ + && pushd docs \ + && rm -rf "${cname_path}" \ + && if [ "${env}" == "prod" ]; then + echo "${domain}" > "${cname_path}" + fi \ + && mkdocs gh-deploy --force --no-history +} + +main "${@}" diff --git a/makes/docs/deploy/main.nix b/makes/docs/deploy/main.nix new file mode 100644 index 00000000..b43a6e3d --- /dev/null +++ b/makes/docs/deploy/main.nix @@ -0,0 +1,10 @@ +{ + makeScript, + outputs, + ... +}: +makeScript { + name = "docs-deploy"; + entrypoint = ./entrypoint.sh; + searchPaths.source = [outputs."/docs/runtime"]; +} diff --git a/makes/docs/entrypoint.sh b/makes/docs/dev/entrypoint.sh similarity index 79% rename from makes/docs/entrypoint.sh rename to makes/docs/dev/entrypoint.sh index b5784598..d9630eda 100644 --- a/makes/docs/entrypoint.sh +++ b/makes/docs/dev/entrypoint.sh @@ -3,7 +3,7 @@ function main { : \ && pushd docs \ - && mkdocs "${@}" + && mkdocs serve } main "${@}" diff --git a/makes/docs/main.nix b/makes/docs/dev/main.nix similarity index 86% rename from makes/docs/main.nix rename to makes/docs/dev/main.nix index aea43730..6085c265 100644 --- a/makes/docs/main.nix +++ b/makes/docs/dev/main.nix @@ -4,7 +4,7 @@ ... }: makeScript { - name = "docs"; + name = "docs-dev"; entrypoint = ./entrypoint.sh; searchPaths.source = [outputs."/docs/runtime"]; }