Skip to content

Commit

Permalink
Deploy web test to github pages (#397)
Browse files Browse the repository at this point in the history
* deploy web-test to pages

* fix: workflow syntax

* fix: workflow syntax

* fix: rename

* fix: action

* fix

* fix

* fix for upstream
  • Loading branch information
qiweiii authored Sep 13, 2023
1 parent d5f0e15 commit ee399ab
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Deploy

on:
push:
branches: [ master ]

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
executor/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2022-10-30
components: rustfmt
target: wasm32-unknown-unknown
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- name: Build packages
run: |
yarn --immutable
yarn check
yarn build-wasm
yarn build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './packages/web-test/dist'

deploy-web-test:
needs: setup
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
1 change: 1 addition & 0 deletions packages/web-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"license": "Apache-2.0",
"private": true,
"scripts": {
"build": "npx vite build",
"vite:serve": "npx vite --port 3000 --host",
"parcel:serve": "npx parcel serve index.html --port 3000",
"test": "npx playwright test"
Expand Down
1 change: 1 addition & 0 deletions packages/web-test/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import tsconfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
plugins: [tsconfigPaths()],
base: '/chopsticks/',
})

0 comments on commit ee399ab

Please sign in to comment.