From a219bd390614f2f9efd693b02eef63b5463c833c Mon Sep 17 00:00:00 2001 From: hrodmn Date: Wed, 4 Dec 2024 21:07:45 -0600 Subject: [PATCH] add netrc to docs build --- .github/workflows/docs.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a5192ce..26623ae 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,18 +37,21 @@ jobs: git config --local user.email "actions@github.com" - 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