Skip to content

Commit

Permalink
add deploy on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
rflamary committed Feb 21, 2024
1 parent f720ffb commit 0ddf351
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
root: docs/build
paths:
- html

deploy_main:
docker:
- image: cimg/python:3.10
Expand Down Expand Up @@ -124,6 +125,41 @@ jobs:
echo "No deployment (build: ${CIRCLE_BRANCH}).";
fi
deploy_tag:
docker:
- image: cimg/python:3.10
steps:
- attach_workspace:
at: /tmp/build
- run:
name: Fetch docs
command: |
set -e
mkdir -p ~/.ssh
echo -e "Host *\nStrictHostKeyChecking no" > ~/.ssh/config
chmod og= ~/.ssh/config
if [ ! -d ~/scikit-adaptation.github.io ]; then
git clone [email protected]:/scikit-adaptation/scikit-adaptation.github.io ~/scikit-adaptation.github.io --depth=1
fi
- run:
name: Deploy docs
command: |
set -e;
git config --global user.email "[email protected]";
git config --global user.name "Circle CI";
cd ~/scikit-adaptation.github.io;
git checkout main
git remote -v
git fetch origin
git reset --hard origin/main
git clean -xdf
echo "Deploying dev docs for ${CIRCLE_BRANCH}.";
cp -a /tmp/build/html/* .;
touch .nojekyll;
git add -A;
git commit -m "CircleCI update of dev docs (${CIRCLE_BUILD_NUM}).";
git push origin main;
workflows:
version: 2
Expand All @@ -141,4 +177,12 @@ workflows:
filters:
branches:
only:
- main
- main
- deploy_tag:
requires:
- build_docs
filters:
branches:
ignore: /.*/
tags:
only: /[0-9]+(\.[0-9]+)*$/

0 comments on commit 0ddf351

Please sign in to comment.