@@ -3,10 +3,10 @@ name: Build & update docs
33
44on :
55 push :
6- branches : [ 'doc/*', 'docs/*', master, "maint/*" ]
6+ branches : [ 'doc/*', 'docs/*', master, main, "maint/*" ]
77 tags : [ '*' ]
88 pull_request :
9- branches : [ master, 'maint/*' ]
9+ branches : [ master, main, 'maint/*' ]
1010
1111concurrency :
1212 group : ${{ github.workflow }}-${{ github.ref }}
@@ -92,17 +92,17 @@ jobs:
9292 git push
9393
9494 - name : Push "master" docs to gh-pages after a push to master (typically, a PR merge).
95- if : github.ref == 'refs/heads/master'
95+ if : github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
9696 run : |
97- if [[ "${CURBRANCH}" != "master" ]]; then
97+ if [[ "${CURBRANCH}" != "master" -a "${CURBRANCH}" != "main" ]]; then
9898 echo "$CURBRANCH is not the default development branch"
9999 exit 1
100100 fi
101101 git checkout -b gh-pages origin/gh-pages
102- git rm -r master / || true
102+ git rm -r ${CURBRANCH} / || true
103103 # It is fundamental that the directory does not exist at all.
104- rm -rf master
105- cp -r $HOME/docs/$CURBRANCH $PWD/master
106- git add master
107- git commit -am "docs(master ): Update docs of development line" || true
104+ rm -rf ${CURBRANCH}
105+ cp -r $HOME/docs/$CURBRANCH $PWD/${CURBRANCH}
106+ git add ${CURBRANCH}
107+ git commit -am "docs(${CURBRANCH} ): Update docs of development line" || true
108108 git push
0 commit comments