Skip to content

Commit

Permalink
Merge pull request #45 from esl-epfl/website
Browse files Browse the repository at this point in the history
Website
  • Loading branch information
danjjl authored Nov 14, 2024
2 parents 1aee222 + 11e27be commit 4000dd6
Show file tree
Hide file tree
Showing 13 changed files with 427 additions and 462 deletions.
62 changes: 32 additions & 30 deletions .github/workflows/3-build-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,41 @@ permissions:
id-token: write

jobs:
download:
build:
runs-on: ubuntu-latest
steps:
- name: Download results
run: |
aws s3 cp \
s3://${AWS_BUCKET}/results/results.json \
website/data/sampleEval.json
aws s3 sync s3://${AWS_BUCKET}/results/ ./results
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
AWS_BUCKET: ${{secrets.AWS_BUCKET }}

- name: Concatenate JSONs
run: |
result="./results.json"
echo "{}" > "$result"
for algorithm_dir in ./results/*/; do
algorithm_name=$(basename "$algorithm_dir")
algorithm_obj="{}"
for dataset_file in "$algorithm_dir"*.json; do
dataset_name=$(basename "$dataset_file" .json)
algorithm_obj=$(jq --arg dataset_name "$dataset_name" \
--argjson dataset_content "$(cat "$dataset_file")" \
'. + {($dataset_name): $dataset_content}' <<< "$algorithm_obj")
done
jq --arg algorithm_name "$algorithm_name" \
--argjson algorithm_obj "$algorithm_obj" \
'. + {($algorithm_name): $algorithm_obj}' <<< "$(<"$result")" > "$result"
done
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: web-data
path: website/data/


build:
needs: download
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository }}-site-builder:main
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:

- name: Checkout repository
uses: actions/checkout@v4

- name: download artifact
uses: actions/download-artifact@v4
with:
name: web-data
path: website/data/

- name: Build website
run: python /app/script.py website/data/sampleEval.json

name: results
path: ./results.json

deploy:
needs: build
Expand All @@ -69,6 +61,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Download results.json
uses: actions/download-artifact@v4
with:
name: results
path: website/public/results.json

- name: Copy algorithms
run: |
cp -r ./algorithms website/public/algorithms
- name: Setup Pages
uses: actions/configure-pages@v5

Expand Down
98 changes: 0 additions & 98 deletions .github/workflows/docker-publish-site-builder.yml

This file was deleted.

19 changes: 0 additions & 19 deletions website/Dockerfile

This file was deleted.

53 changes: 0 additions & 53 deletions website/algo_details_script.py

This file was deleted.

82 changes: 0 additions & 82 deletions website/layout.py

This file was deleted.

Loading

0 comments on commit 4000dd6

Please sign in to comment.