Skip to content

Commit dc57306

Browse files
committed
chore: Enable docs workflow for main branch
1 parent ab96e6e commit dc57306

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/docs-build-update.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Build & update docs
33

44
on:
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

1111
concurrency:
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

Comments
 (0)