Skip to content

Commit

Permalink
Tweak docs workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fjclark committed Sep 24, 2024
1 parent 9520627 commit c21beaf
Showing 1 changed file with 35 additions and 43 deletions.
78 changes: 35 additions & 43 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,38 @@ jobs:
container: condaforge/mambaforge:latest

steps:
- uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/test.yaml
environment-name: red
create-args: >- # beware the >- instead of |, we don't split on newlines but on spaces
python=3.12
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
micromamba install -y -n red -c conda-forge -c defaults git make
apt update && apt install -y git make
python -m pip install . --no-deps
micromamba list
- name: Determine Version
shell: bash
run: |
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
echo "VERSION=latest" >> $GITHUB_ENV
elif [ "${GITHUB_REF#refs/tags/}" != "$GITHUB_REF" ]; then
VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
echo "VERSION=$VERSION stable" >> $GITHUB_ENV
else
echo "Invalid ref: $GITHUB_REF"
exit 1
fi
- name: Build and Deploy Documentation
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git config --global --add safe.directory "$PWD"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git fetch --all --prune
make env
make docs-deploy VERSION="$VERSION"
- name: Prepare container
run: |
apt update && apt install -y git make
- name: Checkout
uses: actions/checkout@v4

- name: Determine Version
shell: bash
run: |
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
echo "VERSION=latest" >> $GITHUB_ENV
elif [ "${GITHUB_REF#refs/tags/}" != "$GITHUB_REF" ]; then
VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
echo "VERSION=$VERSION stable" >> $GITHUB_ENV
else
echo "Invalid ref: $GITHUB_REF"
exit 1
fi
- name: Build and Deploy Documentation
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git config --global --add safe.directory "$PWD"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git fetch --all --prune
mamba create --file devtools/conda-envs/test.yaml
mamba activate red
pip install --no-deps -e .
pre-commit install || true
make docs-deploy VERSION="$VERSION"

0 comments on commit c21beaf

Please sign in to comment.