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 a219bd3
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,21 @@ jobs:
git config --local user.email "[email protected]"
- name: Deploy docs
env:
EARTHDATA_USERNAME: ${{ secrets.earthdata_username }}
EARTHDATA_PASSWORD: ${{ secrets.earthdata_password }}
run: |
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
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
else
# For develop branch, deploy to 'dev'
uv run mike deploy --push --update-aliases dev
Expand Down

0 comments on commit a219bd3

Please sign in to comment.