Skip to content

Build website

Build website #1

name: Build website
on:
workflow_run:
workflows: ["Execute algorithm and evaluate metrics"]
branches: [main]
types:
- completed
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
download:
runs-on: ubuntu-latest
steps:
- name: Download results
run: |
aws s3 cp \
s3://${AWS_BUCKET}/results/results.json \
website/data/sampleEval.json
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: 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
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'website/public'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4