From 412232a632dc22c8e664a220dba39b83f065f99c Mon Sep 17 00:00:00 2001 From: Winford Date: Sun, 13 Oct 2024 16:53:42 -0700 Subject: [PATCH] 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 --- .github/workflows/publish-docs.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml index 1e594bb2d..23efde316 100644 --- a/.github/workflows/publish-docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -113,6 +113,7 @@ jobs: make GitHub_CI_Publish_Docs - name: Commit files + id: commit_files if: github.repository == 'atomvm/AtomVM' working-directory: /home/runner/work/AtomVM/AtomVM/www run: | @@ -122,17 +123,16 @@ jobs: if [ -n "$(git status --porcelain=v1)" ]; then git add . git commit -m "Update Documentation" + echo "PUBLISH=true" >> "$GITHUB_OUTPUT" fi - name: Push changes - if: github.repository == 'atomvm/AtomVM' + if: github.repository == 'atomvm/AtomVM' && steps.commit_files.outputs.PUBLISH == 'true' working-directory: /home/runner/work/AtomVM/AtomVM/www run: | - if [ -n "$(git status --porcelain=v1)" ]; then - eval `ssh-agent -t 60 -s` - echo "${{ secrets.PUBLISH_ACTION_KEY }}" | ssh-add - - mkdir -p ~/.ssh/ - ssh-keyscan github.com >> ~/.ssh/known_hosts - git remote add push_dest "git@github.com:atomvm/atomvm_www.git" - git fetch push_dest - git push --set-upstream push_dest Production - fi + eval `ssh-agent -t 60 -s` + echo "${{ secrets.PUBLISH_ACTION_KEY }}" | ssh-add - + mkdir -p ~/.ssh/ + ssh-keyscan github.com >> ~/.ssh/known_hosts + git remote add push_dest "git@github.com:atomvm/atomvm_www.git" + git fetch push_dest + git push --set-upstream push_dest Production