Skip to content

Commit

Permalink
set up github page
Browse files Browse the repository at this point in the history
  • Loading branch information
mam10eks committed Feb 4, 2024
0 parents commit 5d22d44
Show file tree
Hide file tree
Showing 27 changed files with 15,868 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

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

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

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Compile Javascript assets
run: |
cd browser
make
mv ./static/dist/index.html static/index.html
mv ./ui/*.jsonl static/
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './static'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions browser/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
> 1%
last 2 versions
not dead
not ie 11
8 changes: 8 additions & 0 deletions browser/.devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"image": "mam10eks/github-page-tutorial:0.0.2",
"customizations": {
"vscode": {
"extensions": ["ms-python.python", "ms-python.vscode-pylance", "ms-toolsai.jupyter"]
}
}
}
5 changes: 5 additions & 0 deletions browser/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
14 changes: 14 additions & 0 deletions browser/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
],
rules: {
'vue/multi-word-component-names': 'off',
},
}
23 changes: 23 additions & 0 deletions browser/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
/static

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
6 changes: 6 additions & 0 deletions browser/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build-ui-docker:
docker run --rm -v ${PWD}:/app -v ${PWD}/static/dist/:/dist -w /app --entrypoint vite mam10eks/github-page-tutorial:0.0.2 build

coverage:
pytest --cov=construct_indices \
&& coverage-badge -o construct_indices/coverage.svg
18 changes: 18 additions & 0 deletions browser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# base

## Project setup

We use a dev-container. In the dev container, compile everthing via

```
vite dev
```

### Compilation

```
```

### Customize configuration

See [Configuration Reference](https://vitejs.dev/config/).
15 changes: 15 additions & 0 deletions browser/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
10 changes: 10 additions & 0 deletions browser/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|tsx|jsx)?$': 'ts-jest',
"^.+\\.(js|jsx)$": "babel-jest",
},
"coverageReporters": ["json-summary", "text", "lcov"],
"collectCoverageFrom" : ["src/ir_datasets.ts", "src/utils.ts", "src/main.ts"],
};
Loading

0 comments on commit 5d22d44

Please sign in to comment.