diff --git a/.ci/build.sh b/.ci/build.sh index bca9014..87e1132 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -7,6 +7,11 @@ yarn --cwd ./scripts/shared-hugo-scripts/wiki/ yarn --cwd ./scripts/shared-hugo-scripts/compatdb/ yarn hugo version echo -e '\e[1m\e[36m========== Starting gulp deploy task ===============\e[0m' -yarn run build +if [[ -n "${EPHEMERAL_BASE_URL}" ]]; then + echo -e "\e[1m\e[36m========== Ephemeral Mode URL: ${EPHEMERAL_BASE_URL} ===============\e[0m" + yarn run gulp all --ephemeral "${EPHEMERAL_BASE_URL}" +else + yarn run build +fi echo -e '\e[1m\e[32m Success! Site deployed to `build` folder.\e[0m' diff --git a/gulpfile.js b/gulpfile.js index b6dc62f..14fd679 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -102,12 +102,18 @@ gulp.task('final:publish', function(done) { const cname = 'citra-emu.org'; var finalCommand = null; +let ephemeralURL = null; if (parseArgs(process.argv).production) { process.env.NODE_ENV = 'production'; process.env.HUGO_ENV = 'PRD'; process.env.HUGO_BASEURL = `https://${cname}`; finalCommand = 'final:publish'; +} else if ((ephemeralURL = parseArgs(process.argv).ephemeral)) { + process.env.NODE_ENV = 'production'; + process.env.HUGO_ENV = 'PRD'; + process.env.HUGO_BASEURL = ephemeralURL; + finalCommand = 'final:publish'; } else { process.env.HUGO_ENV = 'DEV'; process.env.HUGO_BASEURL = 'http://localhost:3000';