Skip to content

Commit

Permalink
try and add push to gh pages
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCARPi committed Nov 18, 2023
1 parent da0ab81 commit c28b5c9
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 2 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/push_demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy demo to Pages

on:
push:
branches: ["master"]

# Allow running manually from the Actions tab
workflow_dispatch:

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@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '20.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build dist files
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'demo'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/*
node_modules/
demo/malle.js
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
assets
demo
docker
node_modules
src
Expand Down
2 changes: 1 addition & 1 deletion demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import config from './config.js';

// in dev mode the lib is in the parent folder, but in the docker image it is in the current dir
let libPath = './dist/main.js';
let libPath = './malle.js';
if (config.env === 'dev') {
libPath = '.' + libPath;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dist/*.d.ts"
],
"scripts": {
"build": "tsc",
"build": "tsc && cp -v dist/main.js demo/malle.js",
"lint": "eslint src",
"dev-server": "docker run --rm -it --name malle-dev -p 4813:80 -v $(pwd):/usr/share/nginx/html:ro -d nginx:stable-alpine",
"pre-commit": "npm run lint && npm run test",
Expand Down

0 comments on commit c28b5c9

Please sign in to comment.