Skip to content

Commit

Permalink
add netrc to docs build
Browse files Browse the repository at this point in the history
  • Loading branch information
hrodmn committed Dec 5, 2024
1 parent 7d66dff commit 60dbc47
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,22 @@ jobs:
git config --local user.email "[email protected]"
- name: Deploy docs
env:
EARTHDATA_USERNAME: ${{ secrets.earthdata_username }}
EARTHDATA_PASSWORD: ${{ secrets.earthdata_password }}
run: |
echo "machine urs.earthdata.nasa.gov\nlogin ${EARTHDATA_USERNAME}\npassword ${EARTHDATA_PASSWORD}" > ~/.netrc
if [[ $GITHUB_REF == refs/tags/* ]]; then
# For tags, deploy the tagged version
VERSION=${GITHUB_REF#refs/tags/v}
uv run mike deploy --push $VERSION
# If this is the latest version, update the 'latest' alias
LATEST_TAG=$(git tag --sort=-creatordate | head -n 1)
if [[ "v$VERSION" == "$LATEST_TAG" ]]; then
uv run mike alias --push $VERSION latest
uv run mike set-default --push latest
fi
if [[ "v$VERSION" == "$LATEST_TAG" ]]; then
uv run mike alias --push $VERSION latest
uv run mike set-default --push latest
fi
else
# For develop branch, deploy to 'dev'
uv run mike deploy --push --update-aliases dev
Expand All @@ -73,7 +77,11 @@ jobs:
# Only build and deploy if PR is opened/synchronized/reopened
- name: Build docs
if: github.event.action != 'closed'
env:
EARTHDATA_USERNAME: ${{ secrets.earthdata_username }}
EARTHDATA_PASSWORD: ${{ secrets.earthdata_password }}
run: |
echo "machine urs.earthdata.nasa.gov\nlogin ${EARTHDATA_USERNAME}\npassword ${EARTHDATA_PASSWORD}" > ~/.netrc
uv run mkdocs build --site-dir site/pr-${{ github.event.pull_request.number }}
- name: Deploy preview
Expand Down

0 comments on commit 60dbc47

Please sign in to comment.