Skip to content

Commit be48634

Browse files
committed
added website with build action
1 parent a283a36 commit be48634

22 files changed

+3902
-252
lines changed

.github/workflows/deploy.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
# Trigger the workflow every time you push to the `main` branch
5+
# Using a different branch name? Replace `main` with your branch’s name
6+
push:
7+
branches: [ main ]
8+
# Allows you to run this workflow manually from the Actions tab on GitHub.
9+
workflow_dispatch:
10+
11+
# Allow this job to clone the repo and create a page deployment
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout your repository using git
22+
uses: actions/checkout@v4
23+
- name: Install, build, and upload your site
24+
uses: withastro/action@v2
25+
with:
26+
# path: . # The root location of your Astro project inside the repository. (optional)
27+
node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
28+
package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
29+
30+
deploy:
31+
needs: build
32+
runs-on: ubuntu-latest
33+
environment:
34+
name: github-pages
35+
url: ${{ steps.deployment.outputs.page_url }}
36+
steps:
37+
- name: Deploy to GitHub Pages
38+
id: deployment
39+
uses: actions/deploy-pages@v4

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
__pycache__
22
venv
33
/cache
4+
/dist

docs/dependencies.dot

-18
This file was deleted.

docs/dependencies.dot.svg

-109
This file was deleted.

docs/index.html

-116
This file was deleted.

docs/style.css

-3
This file was deleted.

graph_utils.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ def graph_to_dot(graph):
1717
dot_string = "digraph G {\n"
1818
nodes_map = {}
1919
for index,node in enumerate(graph["nodes"],1):
20-
nodes_map[node] = int_to_alphabet(index)
20+
nodes_map[node["label"]] = int_to_alphabet(index)
2121
for node in graph["nodes"]:
22-
dot_string += f' {nodes_map[node]} [label="{node}"];\n'
22+
label = node["label"]
23+
node_class = node["class"]
24+
node_shape = shapes_map[node_class]
25+
dot_string += f' {nodes_map[label]} [label="{label}", class="{node_class}", shape="{node_shape}"];\n'
2326
for edge in graph["edges"]:
2427
source = nodes_map[edge["source"]]
2528
target = nodes_map[edge["target"]]
@@ -34,8 +37,8 @@ def add_edge(source,target):
3437
if(target not in graph["nodes"]):
3538
graph["nodes"].append(target)
3639
graph["edges"].append({
37-
"source":source,
38-
"target":target
40+
"source":source["label"],
41+
"target":target["label"]
3942
})
4043
return
4144

@@ -52,3 +55,8 @@ def get_graph():
5255
"nodes":[],
5356
"edges":[]
5457
}
58+
59+
shapes_map = {
60+
"job":"box",
61+
"artifact":"ellipse"
62+
}

manifest.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ pipeline:
77
compute-statistics: pipeline.py#compute
88
build:
99
generate-website: pipeline.py#build
10+
website:
11+
base: pipeline-visualization

runner.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ def set_artifact(data,filepath,type="generic"):
3636
abs_filepath = join("cache",filepath)
3737
if(ext == ".json"):
3838
utl.save_json(data,abs_filepath)
39-
gutl.add_edge(state.job,id)
39+
gutl.add_edge({"label":state.job,"class":"job"},{"label":id,"class":"artifact"})
4040
return
4141

4242
def get_artifact(id):
4343
if(id not in state.artifacts):
4444
raise ArtifactError(f"Artifact with ID '{id}' does not exist")
4545
artifact = state.artifacts[id]
46-
gutl.add_edge(id,state.job)
46+
gutl.add_edge({"label":id,"class":"artifact"},{"label":state.job,"class":"job"})
4747
if(artifact["ext"] == ".json"):
4848
return utl.load_json(join("cache",artifact["filepath"]))
4949
return None

website/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# build output
2+
dist/
3+
4+
# generated types
5+
.astro/
6+
7+
# dependencies
8+
node_modules/
9+
10+
# logs
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store
22+
23+
# jetbrains setting folder
24+
.idea/

website/astro.config.mjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from 'astro/config';
2+
import {config} from './config.js'
3+
4+
// https://astro.build/config
5+
export default defineConfig({
6+
output: 'static',
7+
outDir: config.outDir,
8+
base: config.base
9+
});

0 commit comments

Comments
 (0)