Skip to content

Commit 412232a

Browse files
committed
Fix error in publish docs workflow check
The previos fix would always skip publishing. This sets an environmental output in the commit files stage that can be checked before pushing changes. Signed-off-by: Winford <winford@object.stream>
1 parent d63ea1f commit 412232a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/publish-docs.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ jobs:
113113
make GitHub_CI_Publish_Docs
114114
115115
- name: Commit files
116+
id: commit_files
116117
if: github.repository == 'atomvm/AtomVM'
117118
working-directory: /home/runner/work/AtomVM/AtomVM/www
118119
run: |
@@ -122,17 +123,16 @@ jobs:
122123
if [ -n "$(git status --porcelain=v1)" ]; then
123124
git add .
124125
git commit -m "Update Documentation"
126+
echo "PUBLISH=true" >> "$GITHUB_OUTPUT"
125127
fi
126128
- name: Push changes
127-
if: github.repository == 'atomvm/AtomVM'
129+
if: github.repository == 'atomvm/AtomVM' && steps.commit_files.outputs.PUBLISH == 'true'
128130
working-directory: /home/runner/work/AtomVM/AtomVM/www
129131
run: |
130-
if [ -n "$(git status --porcelain=v1)" ]; then
131-
eval `ssh-agent -t 60 -s`
132-
echo "${{ secrets.PUBLISH_ACTION_KEY }}" | ssh-add -
133-
mkdir -p ~/.ssh/
134-
ssh-keyscan github.com >> ~/.ssh/known_hosts
135-
git remote add push_dest "git@github.com:atomvm/atomvm_www.git"
136-
git fetch push_dest
137-
git push --set-upstream push_dest Production
138-
fi
132+
eval `ssh-agent -t 60 -s`
133+
echo "${{ secrets.PUBLISH_ACTION_KEY }}" | ssh-add -
134+
mkdir -p ~/.ssh/
135+
ssh-keyscan github.com >> ~/.ssh/known_hosts
136+
git remote add push_dest "git@github.com:atomvm/atomvm_www.git"
137+
git fetch push_dest
138+
git push --set-upstream push_dest Production

0 commit comments

Comments
 (0)