Skip to content

add copy button

add copy button #119

name: Build website using results from gh-pages
on:
push:
branches:
- main
# If _all_ the modified files match this filter, it won't trigger this
# workflow
paths-ignore:
- '**/*.jl'
- '*.toml'
- 'ad.py'
- '.github/workflows/refresh_website.yml'
pull_request:
paths:
- '**/*.jl'
- '*.toml'
- 'ad.py'
- '.github/workflows/refresh_website.yml'
workflow_dispatch:
permissions:
actions: write
contents: write
jobs:
refresh-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download results to web/src/data
run: |
curl -O https://raw.githubusercontent.com/TuringLang/ADTests/refs/heads/gh-pages/${PR}adtests.json
curl -O https://raw.githubusercontent.com/TuringLang/ADTests/refs/heads/gh-pages/${PR}manifest.json
curl -O https://raw.githubusercontent.com/TuringLang/ADTests/refs/heads/gh-pages/${PR}model_definitions.json
working-directory: web/src/data
env:
PR: ${{ github.event_name == 'pull_request' && 'pr/' || '' }}
# This isn't needed to build the website, it's just there so that the
# JSON is easily accessible on the gh-pages branch
- name: Copy results to web/public
run: |
cp ../src/data/*.json .
working-directory: web/public
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Install dependencies
run: pnpm install
working-directory: web
- name: Build website
run: pnpm build --base ${{ github.event_name == 'pull_request' && '/ADTests/pr' || '/ADTests' }}
working-directory: web
- name: Upload results
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./web/dist
destination_dir: ${{ github.event_name == 'pull_request' && 'pr' || '' }}
keep_files: true