Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy web test to github pages #397

Merged
merged 9 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/',
})