File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,23 @@ jobs:
2929 if : ${{ success() }}
3030 run : |
3131 invoke docs
32- BRANCH_OR_TAG=${GITHUB_REF##*/}
33- echo "Detected branch/tag: $BRANCH_OR_TAG"
34- if [ $BRANCH_OR_TAG = "master" ]; then
35- BRANCH_OR_TAG="latest"
32+
33+ # Get branch/tag/latest name from git
34+ GITHUB_REF_REGEX="tags/([0-9a-zA-Z\.\-]+)|(pull/[0-9]+)|heads/(.+)"
35+
36+ if [[ $GITHUB_REF =~ $GITHUB_REF_REGEX ]]; then
37+ if [[ $BASH_REMATCH = pull* ]]; then
38+ BRANCH_OR_TAG=pull_${BASH_REMATCH##*/}
39+ else
40+ BRANCH_OR_TAG=${BASH_REMATCH##*/}
41+ fi;
42+ if [[ $BRANCH_OR_TAG = master ]]; then
43+ BRANCH_OR_TAG=latest
44+ fi;
3645 fi;
37- mkdir -p deploy/compas_fab/$BRANCH_OR_TAG && mv -T dist/docs deploy/compas_fab/$BRANCH_OR_TAG/
46+
3847 echo "Docs will be deployed to https://gramaziokohler.github.io/compas_fab/$BRANCH_OR_TAG"
48+ mkdir -p deploy/compas_fab/$BRANCH_OR_TAG && mv -T dist/docs deploy/compas_fab/$BRANCH_OR_TAG/
3949 - name : Deploy docs
4050 if : success()
4151 uses : crazy-max/ghaction-github-pages@v2
You can’t perform that action at this time.
0 commit comments