Change build logic
This commit is contained in:
parent
baf9a277b7
commit
1e3adcef59
17
.github/workflows/build-and-deploy.yml
vendored
17
.github/workflows/build-and-deploy.yml
vendored
@ -15,22 +15,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build # Have to run processing first so the list.json exists to be included in the the deploy
|
- name: Build # Have to run processing first so the list.json exists to be included in the the deploy
|
||||||
run: |
|
run: |
|
||||||
npm ci --prefix processing
|
./build_all_branches.sh
|
||||||
node processing
|
|
||||||
npm ci --prefix site
|
|
||||||
npm run deploy --prefix site
|
|
||||||
|
|
||||||
- name: Generate App List # Have to run it again because the deploy wipes the file and folders out
|
|
||||||
run: |
|
|
||||||
npm ci --prefix processing
|
|
||||||
node processing
|
|
||||||
|
|
||||||
- name: Move to branch
|
|
||||||
if: github.ref != 'refs/heads/develop'
|
|
||||||
run: |
|
|
||||||
mv public ${{ github.head_ref || github.ref_name }}
|
|
||||||
mkdir public
|
|
||||||
mv ${{ github.head_ref || github.ref_name }} public
|
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: JamesIves/github-pages-deploy-action@v4
|
uses: JamesIves/github-pages-deploy-action@v4
|
||||||
|
23
build_all_branches.sh
Executable file
23
build_all_branches.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
DEFAULT=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
|
||||||
|
|
||||||
|
mkdir base
|
||||||
|
cat > base/_redirects << EOF
|
||||||
|
/ /$DEFAULT/ 301
|
||||||
|
/index.html /$DEFAULT/index.html 301
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Generating documentation for each other branch in a subdirectory
|
||||||
|
for BRANCH in $(git branch --remotes --format '%(refname:lstrip=3)' | grep -Ev '^(HEAD|develop)$'); do
|
||||||
|
echo "$BRANCH" >> base/versions.txt
|
||||||
|
git checkout $BRANCH
|
||||||
|
node processing
|
||||||
|
cp -a public/. process
|
||||||
|
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
|
||||||
|
mv public base/$BRANCH
|
||||||
|
done
|
||||||
|
|
||||||
|
mv base public
|
Loading…
Reference in New Issue
Block a user