Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release tags in GHA #266

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/publish_doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
release:
types: [published]
# Allow this workflow manually from the Actions tab
workflow_dispatch:

Expand Down Expand Up @@ -54,13 +56,25 @@ jobs:
- name: Build API reference
run: pdocs as_markdown -o docs/ dcm2bids --overwrite

- name: Build docs for specific release
- name: Build docs for new release
if: github.event_name == 'release'
run: |
echo "Version: $(dcm2bids -v | awk '/dcm2bids/ {print $3}')"
echo "Version: ${{ github.ref_name }}"
mike deploy -p ${{ github.ref_name }} latest -u

# This might be also triggered for new release as it pushes a new tag,
# but it's ok even if there is an error on this run, the previous run is ok.
- name: Build docs for releases already deployed
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: |
echo "Version: $(dcm2bids -v | awk '/dcm2bids/ {print $3}')"
echo "Version: ${{ github.ref_name }}"
mike deploy -p ${{ github.ref_name }}

- name: Deploy dev version
if: ${{ github.ref == 'refs/heads/master' }}
run: |
VERSION=$(dcm2bids -v | awk '/dcm2bids/ {print $3}')
echo "Version: $VERSION"
mike deploy -p $VERSION dev -u