mirror of
https://github.com/yewprint/yewprint
synced 2025-02-16 12:08:25 +00:00
Manually deploy using GitHub Actions build (#70)
Also added API ref doc
This commit is contained in:
parent
bf9f78debe
commit
2f8cd1f358
4 changed files with 64 additions and 24 deletions
51
.github/workflows/main.yml
vendored
Normal file
51
.github/workflows/main.yml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
name: Main Workflow
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
schedule:
|
||||||
|
- cron: 0 0 1 * *
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: cargo test --all-features --verbose
|
||||||
|
|
||||||
|
site:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event_name == 'push' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install wasm-pack
|
||||||
|
run: |
|
||||||
|
curl -sSL https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1/wasm-pack-v0.9.1-x86_64-unknown-linux-musl.tar.gz \
|
||||||
|
| tar xzO wasm-pack-v0.9.1-x86_64-unknown-linux-musl/wasm-pack \
|
||||||
|
> $HOME/.cargo/bin/wasm-pack
|
||||||
|
chmod +x $HOME/.cargo/bin/wasm-pack
|
||||||
|
- run: cargo doc --verbose --all-features
|
||||||
|
- name: Deploy doc
|
||||||
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_dir: ./target/doc
|
||||||
|
- name: Build (Release)
|
||||||
|
run: "./build.sh --release"
|
||||||
|
- name: Move doc to public/api
|
||||||
|
run: mv ./target/doc ./public/api
|
||||||
|
- name: Deploy to Netlify
|
||||||
|
uses: nwtgck/actions-netlify@v1.1
|
||||||
|
with:
|
||||||
|
publish-dir: './public'
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
deploy-message: ${{ github.event.head_commit.message }}
|
||||||
|
production-deploy: true
|
||||||
|
production-branch: main
|
||||||
|
env:
|
||||||
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||||
|
timeout-minutes: 5
|
|
@ -1,24 +1,18 @@
|
||||||
name: Rust
|
name: PR Workflow
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
schedule:
|
|
||||||
- cron: 0 0 1 * *
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
size: ${{ steps.build.outputs.size }}
|
size: ${{ steps.build.outputs.size }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install wasm-pack
|
- name: Install wasm-pack
|
||||||
|
@ -28,19 +22,24 @@ jobs:
|
||||||
> $HOME/.cargo/bin/wasm-pack
|
> $HOME/.cargo/bin/wasm-pack
|
||||||
chmod +x $HOME/.cargo/bin/wasm-pack
|
chmod +x $HOME/.cargo/bin/wasm-pack
|
||||||
- run: cargo test --all-features --verbose
|
- run: cargo test --all-features --verbose
|
||||||
- run: cargo doc --verbose --all-features
|
|
||||||
- name: Build (Release)
|
- name: Build (Release)
|
||||||
id: build
|
id: build
|
||||||
run: "./build.sh --release && echo ::set-output name=size::`cat public/wasm_bg.wasm | wc -c`"
|
run: "./build.sh --release && echo ::set-output name=size::`cat public/wasm_bg.wasm | wc -c`"
|
||||||
|
- name: Deploy to Netlify
|
||||||
|
uses: nwtgck/actions-netlify@v1.1
|
||||||
|
with:
|
||||||
|
publish-dir: './public'
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
deploy-message: ${{ github.event.pull_request.title }}
|
||||||
|
env:
|
||||||
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||||
|
timeout-minutes: 1
|
||||||
|
|
||||||
build-main:
|
build-main:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
size: ${{ steps.build.outputs.size }}
|
size: ${{ steps.build.outputs.size }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
@ -56,10 +55,7 @@ jobs:
|
||||||
run: "./build.sh --release && echo ::set-output name=size::`cat public/wasm_bg.wasm | wc -c`"
|
run: "./build.sh --release && echo ::set-output name=size::`cat public/wasm_bg.wasm | wc -c`"
|
||||||
|
|
||||||
checks:
|
checks:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- run: rustup install --profile default nightly
|
- run: rustup install --profile default nightly
|
||||||
|
@ -73,13 +69,9 @@ jobs:
|
||||||
|
|
||||||
report-wasm-size:
|
report-wasm-size:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
needs:
|
needs:
|
||||||
- build
|
- build
|
||||||
- build-main
|
- build-main
|
||||||
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: mshick/add-pr-comment@v1
|
- uses: mshick/add-pr-comment@v1
|
||||||
env:
|
env:
|
|
@ -1,4 +1,4 @@
|
||||||
# <a href="https://yewprint.rm.rs"><img src="./yewprint-doc/src/logo.svg" height="32" /></a> <a href="https://yewprint.rm.rs">Yewprint</a> ![Rust](https://github.com/cecton/yewprint/workflows/Rust/badge.svg) [![Netlify Status](https://api.netlify.com/api/v1/badges/17f076ed-49e5-4185-921e-5c5759de2fdb/deploy-status)](https://app.netlify.com/sites/epic-poincare-f8adaa/deploys) [![Discord](https://img.shields.io/discord/701068342760570933)](https://discord.gg/NAFcwhp)
|
# <a href="https://yewprint.rm.rs"><img src="./yewprint-doc/src/logo.svg" height="32" /></a> <a href="https://yewprint.rm.rs">Yewprint</a> ![Rust](https://github.com/cecton/yewprint/workflows/Rust/badge.svg) [![Netlify Status](https://api.netlify.com/api/v1/badges/17f076ed-49e5-4185-921e-5c5759de2fdb/deploy-status)](https://app.netlify.com/sites/epic-poincare-f8adaa/deploys) [![Discord](https://img.shields.io/discord/701068342760570933)](https://discord.gg/NAFcwhp) [![API Docs](https://img.shields.io/badge/docs.rs-yewprint-green)](https://yewprint.rm.rs/api/yewprint/)
|
||||||
|
|
||||||
|
|
||||||
It's [Blueprint](https://blueprintjs.com), but for
|
It's [Blueprint](https://blueprintjs.com), but for
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[build]
|
|
||||||
publish = "public"
|
|
||||||
command = "curl -sSL https://sh.rustup.rs | sh -s -- -q -y --profile minimal && source $HOME/.cargo/env && curl -sSL https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1/wasm-pack-v0.9.1-x86_64-unknown-linux-musl.tar.gz | tar xzO wasm-pack-v0.9.1-x86_64-unknown-linux-musl/wasm-pack > $HOME/.cargo/bin/wasm-pack && chmod +x $HOME/.cargo/bin/wasm-pack && ./build.sh"
|
|
Loading…
Add table
Reference in a new issue