Automatically set branch version

Better branch support
This commit is contained in:
Chris Hunt 2023-04-03 17:19:48 +01:00
parent 5e8f854b79
commit ef1ecca0ca
No known key found for this signature in database
2 changed files with 3 additions and 1 deletions

View File

@ -17,7 +17,7 @@ We have tried to make it as simple as possible for people to create their own re
* icon - The image to display for your registry. You can upload an image to `/site/public/` and reference that by https://domain.com/1.0/image.png or if you aren't using a {sub}domain by referencing it from https://username.github.io/repositoryname/1.0/image.png where image.png is the name of the image you uploaded.
* listUrl - The link to the root of your site. For example https://username.github.io/repositoryname/ it should always include a trailing slash.
* contactUrl - A link users can use to contact you on.
If you are using a domain or a subdomain, your basePath will just be the current version number `basePath: '/1.0',`, otherwise change the value to include what you chose for the repository name in step 2 `basePath: '/repositoryname/1.0',`.
If you are using a domain or a subdomain, your basePath will just be `basePath: '/1.0',`, otherwise change the value to include what you chose for the repository name in step 2 `basePath: '/repositoryname/1.0',`. the `1.0` will be replaced with the branch name automatically, so you should always keep it as 1.0.
1. Upload your workspaces to the /workspaces folder
1. Go to Settings then Pages and select Branch - gh-pages and click Save
1. Check progress in Actions

View File

@ -17,9 +17,11 @@ for BRANCH in $(git branch --remotes --format '%(refname:lstrip=3)' | grep -Ev '
git checkout $BRANCH
node processing
cp -a public/. process
sed -i "s/1.0/$SANITIZED_BRANCH/" site/next.config.js
npm run deploy --prefix site
cp -a process/. public/ # Have to run it again because the deploy wipes the file and folders out
rm -rf process
sed -i "s/$SANITIZED_BRANCH/1.0/" site/next.config.js # Set it back to 1.0 so it can be changed again on the next loop
mv public base/$SANITIZED_BRANCH
cp base/$SANITIZED_BRANCH/favicon.ico base/favicon.ico
done