Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): Add whitepaper preview #98

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/pages_whitepaper_preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Whitepaper Preview Deploy

on:
# When a PR is merged (or force push to main)
pull_request:
types:
- opened
- reopened
- synchronize
- closed
paths:
- "whitepaper/**/"
- ".github/workflows/pages_whitepaper_preview.yaml"

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pull-requests: write

concurrency: preview-${{ github.ref }}

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
# -=-=-=-= Strictdoc =-=-=-=-
- uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
with:
name: dlr-ft
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- run: nix build .?submodules=1#whitepaper --print-build-logs

- run: mkdir output && cp ./result ./output/whitepaper.pdf && cp ./whitepaper/index.html ./output/index.html

# -=-=-=-= Deploy =-=-=-=-
- name: Deploy Preview
uses: rossjrw/[email protected]
with:
source-dir: output/
umbrella-dir: whitepaper/pr-preview
16 changes: 16 additions & 0 deletions whitepaper/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=./whitepaper.pdf" />
<meta charset="UTF-8" />
<title>Wasm Interpreter Whitepaper</title>
<script type="text/javascript">
george-cosma marked this conversation as resolved.
Show resolved Hide resolved
window.location.href = "./whitepaper.pdf";
</script>
</head>

<body>
If you are seeing this page, follow this link
<a href="./whitepaper.pdf">to the whitepaper</a>.
</body>
</html>