Skip to content

Commit a19ac34

Browse files
committed
Remove .docs suffix from directory when deploying
1 parent 51cc241 commit a19ac34

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ jobs:
2929
- name: Clone target repo
3030
run: |
3131
git clone https://x-access-token:${{ secrets.TARGET_REPO_PAT }}@github.com/explodinglabs/explodinglabs.com.git target-repo
32-
rm -rf target-repo/$(basename "$GITHUB_REPOSITORY")
33-
mkdir -p target-repo/$(basename "$GITHUB_REPOSITORY")
34-
cp -a site/. target-repo/$(basename "$GITHUB_REPOSITORY")/
32+
PROJECT_NAME=${GITHUB_REPOSITORY##*/} # get repo name, e.g., superstack.docs
33+
PROJECT_NAME=${PROJECT_NAME%.docs} # remove .docs suffix if present
34+
rm -rf target-repo/$PROJECT_NAME
35+
mkdir -p target-repo/$PROJECT_NAME
36+
cp -a site/. target-repo/$PROJECT_NAME/
3537
env:
3638
GIT_AUTHOR_NAME: GitHub Actions
3739
GIT_COMMITTER_NAME: GitHub Actions

0 commit comments

Comments
 (0)