diff --git a/.github/workflows/build-spec.yml b/.github/workflows/build-spec.yml index 11ebe26..797c290 100644 --- a/.github/workflows/build-spec.yml +++ b/.github/workflows/build-spec.yml @@ -27,7 +27,7 @@ jobs: uses: actions/upload-pages-artifact@v3 with: # Upload entire repository - path: 'assets' + path: 'dist' deploy: needs: build diff --git a/build.sh b/build.sh index 8f327b8..791b382 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,7 @@ # Execute this from your document repo's root # REPO_DIR="$(dirname $(realpath ${BASH_SOURCE[0]}))" -dist_dir="${REPO_DIR}/assets" +dist_dir="${REPO_DIR}/dist" venv_dir="${REPO_DIR}/.venv" system_python_bin="/usr/bin/python3" venv_python_bin="${venv_dir}/bin/python3" diff --git a/assets/.gitignore b/dist/.gitignore similarity index 56% rename from assets/.gitignore rename to dist/.gitignore index d6b7ef3..7c9d611 100644 --- a/assets/.gitignore +++ b/dist/.gitignore @@ -1,2 +1,3 @@ * !.gitignore +!README.md diff --git a/dist/README.md b/dist/README.md new file mode 100644 index 0000000..25e2cd3 --- /dev/null +++ b/dist/README.md @@ -0,0 +1,9 @@ +# Distribution Directory + +This directory contains all the files that make up the website https://ekgf.github.io/dprod/. + +There are 3 ways to build this website: + +1. Use './build.sh' (a Bash script in the root directory of this repositoru) to build the website. +2. Or push changes to the 'main' branch to trigger a GitHub Actions workflow that will build the website. (Only for code owners) +3. Create a pull request and get it approved which will trigger the same GitHub Actions workflow as described in the previous point. diff --git a/spec-generator.py b/spec-generator.py index 9aecff6..3635a43 100644 --- a/spec-generator.py +++ b/spec-generator.py @@ -236,27 +236,27 @@ def main(): template = env.get_template("template.html") spec = template.render(classes=classes, examples=examples) - with open('assets/index.html', 'w', encoding='utf-8') as f: + with open('dist/index.html', 'w', encoding='utf-8') as f: print(f"Generating home page: ./{f.name}") f.write(spec) - with open('assets/dprod.jsonld', 'w', encoding='utf-8') as f: + with open('dist/dprod.jsonld', 'w', encoding='utf-8') as f: print(f"Generating RDF JSON-LD: ./{f.name}") json_dump = json.dumps(json_ld, indent=4) # print(json_dump) f.write(json_dump) - with open('assets/dprod.ttl', 'w', encoding='utf-8') as f: + with open('dist/dprod.ttl', 'w', encoding='utf-8') as f: print(f"Generating RDF Turtle: ./{f.name}") f.write(g.serialize(format='turtle')) - with open('assets/dprod.rdf', 'w', encoding='utf-8') as f: + with open('dist/dprod.rdf', 'w', encoding='utf-8') as f: print(f"Generating RDF/XML: ./{f.name}") f.write(g.serialize(format='application/rdf+xml')) for img in os.listdir('./images/'): print(f"Copying image: {img}") - shutil.copy2(f'./images/{img}', './assets') + shutil.copy2(f'./images/{img}', './dist') print("Specification generated successfully!")