Skip to content

Commit

Permalink
Github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
xdan committed Sep 19, 2023
1 parent 0026e43 commit e2c7cc4
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 8 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: GitHub Pages

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 #Setup Node
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: APIKEY=${{ secrets.APIKEY }} npm run build
- run: APIKEY=${{ secrets.APIKEY }} npm run examples
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./dist/example

deploy:
needs: build
permissions:
pages: write # to deploy to Pages
id-token: write
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@v2
22 changes: 22 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="en">
<head>
<title>Example @mappable-world/mappable-hint</title>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./common.css" />
</head>
<body>
<iframe width="100%" height="500px" src="./vanilla.html" frameborder="0"></iframe>
<div class="content">
<div class="version">%VERSION%</div>
%README%
</div>
<div class="references">%REFERENCES%</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</body>
</html>
34 changes: 27 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"lint": "eslint ./",
"build": "npm run build:prod && npm run build:esm",
"build:dev": "webpack --mode=development",
"examples": "mappable-cli example --input=example --output=dist/example",
"build:prod": "webpack --mode=production --node-env=production",
"build:esm": "rm -rf ./dist/esm && tsc --project tsconfig.build.json --target es2018 --module es6 --outDir dist/esm",
"watch": "webpack --watch",
Expand All @@ -29,7 +30,7 @@
],
"devDependencies": {
"html-webpack-plugin": "^5.5.3",
"@mappable-world/mappable-cli": "^0.0.3",
"@mappable-world/mappable-cli": "^0.0.16",
"@mappable-world/mappable-types": "^0.0.4",
"@types/got": "9.6.12",
"@types/jest": "29.5.3",
Expand Down

0 comments on commit e2c7cc4

Please sign in to comment.