|
| 1 | +name: Deploy rsonpath-website to Pages |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["main"] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + pages: write |
| 12 | + id-token: write |
| 13 | + |
| 14 | +env: |
| 15 | + CARGO_TERM_COLOR: always |
| 16 | + RUST_BACKTRACE: 1 |
| 17 | + |
| 18 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 19 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 20 | +concurrency: |
| 21 | + group: "pages" |
| 22 | + cancel-in-progress: false |
| 23 | + |
| 24 | +jobs: |
| 25 | + build: |
| 26 | + environment: |
| 27 | + name: github-pages |
| 28 | + url: ${{ steps.deployment.outputs.page_url }} |
| 29 | + runs-on: ubuntu-latest |
| 30 | + steps: |
| 31 | + - name: Install lld |
| 32 | + run: sudo apt install lld |
| 33 | + - name: Cache restore (Cargo) |
| 34 | + id: cache-restore-cargo |
| 35 | + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 |
| 36 | + with: |
| 37 | + path: | |
| 38 | + ~/.cargo/bin/ |
| 39 | + ~/.cargo/registry/index/ |
| 40 | + ~/.cargo/registry/cache/ |
| 41 | + ~/.cargo/git/db/ |
| 42 | + target/ |
| 43 | + - name: cargo install trunk |
| 44 | + uses: baptiste0928/cargo-install@b687c656bda5733207e629b50a22bf68974a0305 # v3.3.2 |
| 45 | + with: |
| 46 | + # Name of the crate to install |
| 47 | + crate: trunk |
| 48 | + env: |
| 49 | + CARGO_TARGET_DIR: target/ |
| 50 | + - name: Checkout sources |
| 51 | + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 |
| 52 | + with: |
| 53 | + repository: rsonquery/rsonpath |
| 54 | + ref: wasm |
| 55 | + submodules: true |
| 56 | + - name: Build with trunk |
| 57 | + run: |
| 58 | + cd web/rsonpath-website |
| 59 | + trunk build --release -d ./dist |
| 60 | + - name: Setup Pages |
| 61 | + uses: actions/configure-pages@v5 |
| 62 | + - name: Upload artifact |
| 63 | + uses: actions/upload-pages-artifact@v3 |
| 64 | + with: |
| 65 | + path: './web/rsonpath-website/dist' |
| 66 | + - name: Deploy to GitHub Pages |
| 67 | + id: deployment |
| 68 | + uses: actions/deploy-pages@v4 |
0 commit comments