Skip to content

Commit

Permalink
add publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Greegko committed Nov 29, 2022
1 parent 2807b05 commit 3e95a28
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/rpg-village-web-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: website

on: push

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: install dependencies
run: yarn
- name: build
run: yarn build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/web/public
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"start": "concurrently \"npm:start:*\"",
"start:core": "npm run build:watch --prefix packages/core",
"start:web": "npm run start --prefix packages/web",
"build": "npm run build:core && npm run build:web",
"build:core": "npm run build --prefix packages/core",
"build:web": "npm run build --prefix packages/web",
"test:core": "npm run test:watch --prefix packages/core-test",
"prepare": "for P in packages/*/; do (cd $P && yarn prepare); done"
},
Expand Down
7 changes: 5 additions & 2 deletions packages/web/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules/
public/
public/*

!public/404.html
!public/CNAME
!public/index.html
23 changes: 23 additions & 0 deletions packages/web/public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Single Page Apps for GitHub Pages</title>
<script type="text/javascript">
// https://github.com/rafgraph/spa-github-pages
var pathSegmentsToKeep = 0;

var l = window.location;
l.replace(
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' +
l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') +
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
l.hash
);

</script>
</head>
<body>
</body>
</html>
1 change: 1 addition & 0 deletions packages/web/public/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpg-village.greegko.com
15 changes: 15 additions & 0 deletions packages/web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@
padding: 0px;
}
</style>
<script type="text/javascript">
// https://github.com/rafgraph/spa-github-pages
(function (l) {
if (l.search[1] === "/") {
var decoded = l.search
.slice(1)
.split("&")
.map(function (s) {
return s.replace(/~and~/g, "&");
})
.join("?");
window.history.replaceState(null, null, l.pathname.slice(0, -1) + decoded + l.hash);
}
})(window.location);
</script>
</head>

<body>
Expand Down

0 comments on commit 3e95a28

Please sign in to comment.