Skip to content

Commit 52379ef

Browse files
committed
ci: Use env to specify doc path
1 parent ba9443a commit 52379ef

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/docs.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ concurrency:
2020
group: ${{ github.workflow }}-${{ github.ref }}
2121
cancel-in-progress: true
2222

23+
env:
24+
DOC_PATH: ~/emacs-eask.github.io
25+
2326
jobs:
2427
publish-doc:
2528
runs-on: ubuntu-latest
@@ -48,19 +51,23 @@ jobs:
4851
if: github.ref == 'refs/heads/master'
4952
with:
5053
repository: emacs-eask/emacs-eask.github.io
51-
path: ~/emacs-eask.github.io
54+
path: ${{ env.DOC_PATH }}
5255
token: ${{ secrets.PAT }}
5356

57+
- name: Clean up before the build
58+
working-directory: ${{ env.DOC_PATH }}
59+
run: git rm -r '*'
60+
5461
- name: Build doc artifacts with Hugo
5562
working-directory: docs
5663
run: |
57-
mkdir -p ~/emacs-eask.github.io
58-
hugo --destination ~/emacs-eask.github.io --minify
64+
mkdir -p ${{ env.DOC_PATH }}
65+
hugo --destination ${{ env.DOC_PATH }} --minify
5966
6067
# TODO: Generate better commit message
6168
- name: Publish doc artifacts
6269
if: github.ref == 'refs/heads/master'
63-
working-directory: ~/emacs-eask.github.io
70+
working-directory: ${{ env.DOC_PATH }}
6471
run: |
6572
git config user.name github-actions
6673
git config user.email [email protected]

0 commit comments

Comments
 (0)