Skip to content

Commit

Permalink
feat(back): fluidattacks#1223 pure poetry for docs
Browse files Browse the repository at this point in the history
- Make docs use pure poetry
- Centralize job in single makes.nix
- Stop deploying latest tag and release
- Adapt CI jobs

Signed-off-by: Daniel Salazar <[email protected]>
  • Loading branch information
dsalaza4 committed Dec 19, 2024
1 parent 1c9c199 commit c93b72a
Show file tree
Hide file tree
Showing 15 changed files with 811 additions and 807 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
- uses: richardsimko/update-tag@5bd0e05b035e02d5da3768dbdcfc4e5e0908623e
with:
tag_name: "latest"
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: johnwbyrd/update-release@1d5ec4791e40507e5eca3b4dbf90f0b27e7e4979
with:
files: README.md
release: "latest"
prerelease: true
tag: "latest"
token: ${{ github.token }}
- uses: richardsimko/update-tag@5bd0e05b035e02d5da3768dbdcfc4e5e0908623e
with:
tag_name: "24.12"
Expand Down Expand Up @@ -159,9 +147,9 @@ jobs:
steps:
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
- uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845
name: /docs/deploy
name: /docs deploy prod
with:
args: sh -c "chown -R root:root /github/workspace && nix-env -if . && m . /docs/deploy prod"
args: sh -c "chown -R root:root /github/workspace && nix-env -if . && m . /docs deploy prod"
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}

Expand Down
32 changes: 32 additions & 0 deletions docs/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# shellcheck shell=bash

function _deploy {
local env="${1-}"
local domain="makes.fluidattacks.tech"
local cname_path="src/CNAME"

rm -rf "${cname_path}"
if [ "${env}" == "prod" ]; then
echo "${domain}" > "${cname_path}"
fi
poetry run mkdocs gh-deploy --force --no-history
}

function _dev {
poetry run mkdocs serve
}

function main {
local dir="docs"

pushd "${dir}" || error "${dir} directory not found"
poetry install --no-root

case "${1:-}" in
deploy) _deploy "${@:2}" ;;
dev) _dev "${@:2}" ;;
*) error "Must provide either 'deploy', 'dev' as the first argument" ;;
esac
}

main "${@}"
7 changes: 7 additions & 0 deletions docs/makes.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ __nixpkgs__, makeScript, ... }: {
jobs."/docs" = makeScript {
name = "docs";
entrypoint = ./entrypoint.sh;
searchPaths.bin = [ __nixpkgs__.git __nixpkgs__.poetry ];
};
}
766 changes: 766 additions & 0 deletions docs/poetry.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[virtualenvs]
in-project = true
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "makes-docs-runtime"
name = "docs"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]
Expand All @@ -14,7 +14,6 @@ requests = "2.32.2"
urllib3 = "2.2.2"
certifi = "2024.7.4"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion makes.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ fetchNixpkgs, fetchUrl, makeScript, outputs, projectPath, __nixpkgs__, ...
}: {
imports = [ ./makes/makes.nix ];
imports = [ ./docs/makes.nix ./makes/makes.nix ];
projectIdentifier = "makes-repo";
cache = {
readNixos = true;
Expand Down
17 changes: 0 additions & 17 deletions makes/docs/deploy/entrypoint.sh

This file was deleted.

7 changes: 0 additions & 7 deletions makes/docs/deploy/makes.nix

This file was deleted.

9 changes: 0 additions & 9 deletions makes/docs/dev/entrypoint.sh

This file was deleted.

7 changes: 0 additions & 7 deletions makes/docs/dev/makes.nix

This file was deleted.

6 changes: 0 additions & 6 deletions makes/docs/runtime/makes.nix

This file was deleted.

10 changes: 0 additions & 10 deletions makes/docs/runtime/pypi/makes.nix

This file was deleted.

730 changes: 0 additions & 730 deletions makes/docs/runtime/pypi/poetry.lock

This file was deleted.

4 changes: 0 additions & 4 deletions makes/makes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ in {
./cli/env/runtime/makes.nix
./cli/env/runtime/pypi/makes.nix
./container-image/makes.nix
./docs/deploy/makes.nix
./docs/dev/makes.nix
./docs/runtime/makes.nix
./docs/runtime/pypi/makes.nix
./tests/commitlint/makes.nix
./tests/computeOnAwsBatch/makes.nix
./tests/makeScript/makes.nix
Expand Down

0 comments on commit c93b72a

Please sign in to comment.