Skip to content

Commit 8db9315

Browse files
committed
fix: env syntax
1 parent 2361f46 commit 8db9315

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/gh-pages.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ jobs:
2828
run: git config --global --add safe.directory $GITHUB_WORKSPACE
2929

3030
- name: Build gh-pages
31-
env: |
32-
SOURCEDIR = ./
33-
BUILDDIR = $(SOURCEDIR)/docs
34-
GH_PAGES_DIR_NAME = gh-pages
35-
BRANCH_DIR_NAME = $(subst /,_,$(BRANCH_NAME))
36-
DOCS = "$(GH_PAGES_DIR_NAME)/$(BRANCH_DIR_NAME)"
31+
env:
32+
BUILDDIR: docs
33+
GH_PAGES_DIR_NAME: gh-pages
3734
run: |
35+
safe_branch=$(echo "${GITHUB_REF_NAME}" | tr '/' '-')
36+
DOCS=$(GH_PAGES_DIR_NAME)/$(safe_branch)
3837
rm -rf "$(GH_PAGES_DIR_NAME)"
3938
git clone `git config --get remote.origin.url` --branch gh-pages --depth 1 gh-pages
4039
install -d $(BUILDDIR)
@@ -53,7 +52,7 @@ jobs:
5352
git -C $(GH_PAGES_DIR_NAME) add content.html
5453
git -C $(GH_PAGES_DIR_NAME) add navtree.css
5554
git -C $(GH_PAGES_DIR_NAME) add main.css
56-
git -C $(GH_PAGES_DIR_NAME) add "$(BRANCH_DIR_NAME)/*"
55+
git -C $(GH_PAGES_DIR_NAME) add "$(safe_branch)/*"
5756
-git -C $(GH_PAGES_DIR_NAME) commit -m 'Automatic update of GH pages'
5857
# The pipeline has to lock the execution of this script, so no updates of the branch are done since clone.
5958
git -C $(GH_PAGES_DIR_NAME) push

0 commit comments

Comments
 (0)