Skip to content

Commit

Permalink
Build site in isolated repo (#1490)
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 authored Dec 9, 2023
1 parent e62d09a commit d8d3137
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/forward-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: forward-push

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- dev

jobs:
build-site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.AX_TRIGGER_SITE_TOKEN }}
repository: axmolengine/axmolengine.github.io
event-type: forward-push
6 changes: 3 additions & 3 deletions docs/doc_index.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<meta charset="utf-8">
<title>Redirecting</title>
<noscript>
<meta http-equiv="refresh" content="1; url=https://axmolengine.github.io/axmol/manual/@VERSION@" />
<meta http-equiv="refresh" content="1; url=https://axmolengine.github.io/manual/@VERSION@" />
</noscript>
<script>
window.location.href = 'https://axmolengine.github.io/axmol/manual/@VERSION@';
window.location.href = 'https://axmolengine.github.io/manual/@VERSION@';
</script>
</head>
<body>
Redirecting to <a href="https://axmolengine.github.io/axmol/manual/@VERSION@">https://axmolengine.github.io/axmol/manual/@VERSION@</a>
Redirecting to <a href="https://axmolengine.github.io/manual/@VERSION@">https://axmolengine.github.io/manual/@VERSION@</a>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h1 id="axmol-engine">Axmol Engine</h1>

<h2 id="documentation">API Documentation</h2>

<p>API documentation: <a href="https://axmolengine.github.io/axmol/manual">https://axmolengine.github.io/axmol/manual</a></p>
<p>API documentation: <a href="https://axmolengine.github.io/manual">https://axmolengine.github.io/manual</a></p>

<h2 id="documentation">WASM preview</h2>
<ul>
Expand Down
6 changes: 3 additions & 3 deletions docs/menu_version.js.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function() {
'use strict';

var url_re = /(axmolengine\.github\.io\/axmol\/manual\/)(latest|(\d\.\d+|\d\.\d+\.\d+)(-beta\d)?)\//;
var url_re = /(axmolengine\.github\.io\/manual\/)(latest|(\d\.\d+|\d\.\d+\.\d+)(-beta\d)?)\//;
var url_local = /docs\/dist\/manual\/(latest|(\d\.\d+|\d\.\d+\.\d+)(-beta\d)?)\//;
var current_version_local = '@VERSION@'
var all_versions = [
Expand Down Expand Up @@ -39,8 +39,8 @@
}

function patch_url(url, new_version) {
if(url.includes("axmolengine.github.io/axmol")){
return url.replace(url_re, 'axmolengine.github.io/axmol/manual/' + new_version + '/');
if(url.includes("axmolengine.github.io")){
return url.replace(url_re, 'axmolengine.github.io/manual/' + new_version + '/');
}
else {
return url.replace(url_local, 'docs/dist/manual/' + new_version + '/');
Expand Down

0 comments on commit d8d3137

Please sign in to comment.