Skip to content

Commit

Permalink
fix(build): renamed assets directory to dist
Browse files Browse the repository at this point in the history
  • Loading branch information
jgeluk committed Aug 12, 2024
1 parent 503b464 commit 03ea5eb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'assets'
path: 'dist'

deploy:
needs: build
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions assets/.gitignore → dist/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*
!.gitignore
!README.md
9 changes: 9 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 5 additions & 5 deletions spec-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!")

Expand Down

0 comments on commit 03ea5eb

Please sign in to comment.