update action version logic

This commit is contained in:
Josh de Leeuw 2024-06-06 21:47:50 -04:00
parent 7ddac35c43
commit c6a5691c06

View File

@ -26,12 +26,9 @@ jobs:
- name: Install poetry using pip
run: pipx install poetry==1.8.0
- name: Get current version
id: version
run: echo "version=$(node -p "require('./packages/jspsych/package.json').version")" >> "$GITHUB_ENV"
- name: Select only major version
run: echo "version_major=${{ env.version }}" | awk -F. '{print "v"$1}' >> "$GITHUB_ENV"
- name: Get major version only
id: version_major
run: echo "version_major=v$(node -p "require('./packages/jspsych/package.json').version" | awk -F. '{print $1}')" >> "$GITHUB_ENV"
- name: Config git
run: |
@ -39,7 +36,7 @@ jobs:
git config --global user.email docs@jspsych.org
- name: Deploy docs
run: npm run docs:deploy ${{ env.version_major }}
run: npm run docs:deploy ${{ env.version_major }} latest
- name: Switch to gh-pages branch
run: git checkout gh-pages