Skip to content

Commit

Permalink
added deploy site workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
carloskiki committed Aug 2, 2024
1 parent b7dedd7 commit 102c981
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
49 changes: 46 additions & 3 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ on:
workflow_dispatch:

jobs:
build:
build-release:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -36,5 +39,45 @@ jobs:
generate_release_notes: true
fail_on_unmatched_files: true

permissions:
contents: write
build-site:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install rust with wasm
uses: dtolnay/rust-toolchain@stable
with:
components: rust-src
target: wasm32-unknown-unknown
- name: Install Binstall
uses: cargo-bins/cargo-binstall@main
- name: Install trunk
run: "cargo binstall --no-confirm trunk"
- name: Build website
run: "cd site && trunk build"

deploy-site:
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
id-token: write # to verify the deployment originates from an appropriate source
pages: write # to deploy to Pages

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'site/dist/'
- id: deployment
name: Deploy to GitHub Pages
uses: actions/deploy-pages@v3
9 changes: 9 additions & 0 deletions site/Trunk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build]
# The index HTML file to drive the bundling process.
target = "index.html"
# Build in release mode.
release = true
# The output dir for all final assets.
dist = "/dist"
# The public URL from which assets are to be served.
public_url = "/pulldown-latex/"

0 comments on commit 102c981

Please sign in to comment.