|
| 1 | +name: Deploy Sign Sample to Github Pages |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - push-tlltnpmvwzwm |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: write # for committing to gh-pages branch. |
| 12 | + pages: write |
| 13 | + id-token: write |
| 14 | + |
| 15 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 16 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 17 | +concurrency: |
| 18 | + group: "pages" |
| 19 | + cancel-in-progress: false |
| 20 | + |
| 21 | +jobs: |
| 22 | + Github-Pages-Release: |
| 23 | + |
| 24 | + timeout-minutes: 10 |
| 25 | + |
| 26 | + environment: |
| 27 | + name: github-pages |
| 28 | + url: ${{ steps.deployment.outputs.page_url }} |
| 29 | + |
| 30 | + runs-on: ubuntu-latest |
| 31 | + |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v4 # repo checkout |
| 34 | + |
| 35 | + # Install Rust Nightly Toolchain, with Clippy & Rustfmt |
| 36 | + - name: Install nightly Rust |
| 37 | + uses: dtolnay/rust-toolchain@nightly |
| 38 | + with: |
| 39 | + components: clippy, rustfmt |
| 40 | + |
| 41 | + - name: Add WASM target |
| 42 | + run: rustup target add wasm32-unknown-unknown |
| 43 | + |
| 44 | + - name: Download and install Trunk binary |
| 45 | + run: wget -qO- https://github.com/trunk-rs/trunk/releases/download/v0.18.4/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- |
| 46 | + |
| 47 | + - name: Build with Trunk |
| 48 | + # "${GITHUB_REPOSITORY#*/}" evaluates into the name of the repository |
| 49 | + # using --public-url something will allow trunk to modify all the href paths like from favicon.ico to repo_name/favicon.ico . |
| 50 | + # this is necessary for github pages where the site is deployed to username.github.io/repo_name and all files must be requested |
| 51 | + # relatively as favicon.ico. if we skip public-url option, the href paths will instead request username.github.io/favicon.ico which |
| 52 | + # will obviously return error 404 not found. |
| 53 | + run: ../../trunk build --release --public-url "${GITHUB_REPOSITORY#*/}" |
| 54 | + working-directory: crates/rust-sample-wallet |
| 55 | + env: |
| 56 | + REOWN_PROJECT_ID: ${{ vars.REOWN_PROJECT_ID }} |
| 57 | + |
| 58 | + |
| 59 | + # Deploy to gh-pages branch |
| 60 | + # - name: Deploy 🚀 |
| 61 | + # uses: JamesIves/github-pages-deploy-action@v4 |
| 62 | + # with: |
| 63 | + # folder: dist |
| 64 | + |
| 65 | + |
| 66 | + # Deploy with Github Static Pages |
| 67 | + |
| 68 | + - name: Setup Pages |
| 69 | + uses: actions/configure-pages@v4 |
| 70 | + with: |
| 71 | + enablement: true |
| 72 | + |
| 73 | + - name: Upload artifact |
| 74 | + uses: actions/upload-pages-artifact@v3 |
| 75 | + with: |
| 76 | + # Upload dist dir |
| 77 | + path: './crates/rust-sample-wallet/dist' |
| 78 | + |
| 79 | + - name: Deploy to GitHub Pages 🚀 |
| 80 | + id: deployment |
| 81 | + uses: actions/deploy-pages@v4 |
0 commit comments