Skip to content
Open
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
70 changes: 70 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Simple workflow for running tests on all branches and deploying only from main
name: Test and Deploy to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- "**" # Match all branches

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Job to run tests before deploying
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test

# Deploy job, only runs if tests pass
deploy:
needs: test # Ensures tests pass before deploying
if: github.ref == 'refs/heads/main' # Deploy only from main
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist folder
path: "./dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion src/simulation/SimulationCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn fs_main(@builtin(position) fragCoord: vec4<f32>) -> @location(0) vec4<f32> {
const extraSymbols = [60, 62, 123, 125, 43, 45, 44, 46, 91, 93];
for (let i = 0; i < props.dimensions ** 2; i++)
for (let j = 0; j < tapeLength; j++) {
// if (Math.random() < 0.8) continue;
if (Math.random() < 0.8) continue;
const randomIndex = Math.floor(Math.random() * tapeLength);
initialTape[i * tapeLength + randomIndex] =
extraSymbols[Math.floor(Math.random() * extraSymbols.length)];
Expand Down
7 changes: 4 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';
import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";

export default defineConfig({
base: "/webgpu-self-replicating-programs/",
plugins: [solidPlugin()],
server: {
port: 3000,
},
build: {
target: 'esnext',
target: "esnext",
},
});