Skip to content

Commit 049ea41

Browse files
committed
Build main docs and push to gh-pages branch
1 parent a01232a commit 049ea41

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on: [push, pull_request, workflow_dispatch]
55
jobs:
66
build:
77
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
810

911
steps:
1012
- name: Checkout repository contents
@@ -21,7 +23,8 @@ jobs:
2123
echo "GIT_BRANCH=$(echo $GITHUB_REF | cut -d '/' -f 3)" >> $GITHUB_ENV
2224
./scripts/ci_build_docs.sh
2325
24-
- name: After success steps
26+
# Deploy release branch to mapserver.github.io
27+
- name: Deploy to mapserver.github.io
2528
if: ${{ success() && github.event_name == 'push' && github.repository == 'MapServer/MapServer-documentation' && github.ref_name == 'branch-8-6' }}
2629
run: |
2730
# setup the SSH key
@@ -36,3 +39,11 @@ jobs:
3639
sha=$(git rev-parse --short ${{ github.sha }})
3740
echo "publish website using $GIT_BRANCH branch and commit $sha"
3841
./scripts/ci_deploy_website.sh build /tmp $sha
42+
43+
# Deploy main branch to gh-pages branch (same repo)
44+
- name: Deploy to gh-pages
45+
if: ${{ success() && github.event_name == 'push' && github.repository == 'MapServer/MapServer-documentation' && github.ref_name == 'main' }}
46+
run: |
47+
sha=$(git rev-parse --short ${{ github.sha }})
48+
echo "Publishing main branch (commit $sha) to gh-pages"
49+
./scripts/ci_deploy_gh_pages.sh build $sha ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)