fix(nx-dev): publish docs when on the latest tag (#20182)

This commit is contained in:
Isaac Mann 2023-11-20 09:11:43 -05:00 committed by GitHub
parent 07aff97c56
commit dc3e1404b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -240,12 +240,15 @@ jobs:
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
pnpm nx-release --local=false $GITHUB_REF_NAME
- name: Trigger Docs Release
# Publish docs only on a full release and when publishing the latest version
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'master' }}
# Publish docs only on a full release
if: ${{ !github.event.release.prerelease }}
run: |
# Publish docs only when publishing the latest version
if [ "$(git describe --tags `git rev-list --tags --max-count=1`)" = "$GITHUB_REF_NAME" ]; then
# We force recreate the branch in order to always be up to date and avoid merge conflicts within the automated workflow
git branch -f website
git push -f origin website
fi
env:
GH_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}