Skip to content

Commit

Permalink
Add deployment CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Apr 15, 2024
1 parent e1c69f3 commit 4eb744b
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 4 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish to GitHub pages

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
Github-Pages-Release:
timeout-minutes: 10

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

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

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Add WASM target
run: rustup target add wasm32-unknown-unknown

- name: Clippy
run: cargo clippy -p rue-web

- name: Fmt
run: cargo fmt -- --files-with-diff --check -p rue-web

- name: Install Trunk binary
run: cargo binstall trunk

- name: Build with Trunk
run: |
cd crates/rue-web
trunk build --release --public-url "${GITHUB_REPOSITORY#*/}"
- name: Setup GitHub Pages
uses: actions/configure-pages@v4
with:
enablement: true
token:

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "./crates/rue-web/dist"

- name: Deploy to GitHub Pages 🚀
id: deployment
uses: actions/deploy-pages@v3
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust
name: Build and test Rust code
on:
push:
branches:
Expand All @@ -23,10 +23,10 @@ jobs:
components: clippy, rustfmt

- name: Run tests
run: cargo test --all-features
run: cargo test --all-features --workspace

- name: Clippy
run: cargo clippy
run: cargo clippy --workspace

- name: Fmt
run: cargo fmt -- --files-with-diff --check
run: cargo fmt --workspace -- --files-with-diff --check

0 comments on commit 4eb744b

Please sign in to comment.