etna 2.2.0 #44
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.9" | |
- name: Install Dependencies | |
run: | | |
pip install poetry | |
poetry install | |
- name: Build | |
run: poetry build | |
- name: Publish | |
run: poetry publish -u "${{ secrets.PYPI_LOGIN }}" -p "${{ secrets.PYPI_PASS }}" | |
build-docs: | |
needs: publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.8" | |
- name: Check tag is latest | |
id: check-tag | |
run: | | |
git fetch --tags -f | |
TAGS=$(git tag -l --sort=-version:refname '1.*') | |
UNSTABLE_TAGS_MATCH='\-dev\|\-alpha\|\-beta\|\-rc' | |
if [[ ${{ github.event.release.prerelease }} == true ]]; then | |
TAGS=$(echo "$TAGS" | grep $UNSTABLE_TAGS_MATCH) | |
else | |
TAGS=$(echo "$TAGS" | grep -v $UNSTABLE_TAGS_MATCH) | |
fi | |
LATEST_TAG=$(echo "$TAGS" | head -n 1) | |
if [[ ${{ github.event.release.tag_name }} == $LATEST_TAG ]]; then | |
echo "::set-output name=IS_LATEST::true" | |
else | |
echo "::set-output name=IS_LATEST::false" | |
fi | |
- name: Install dependencies | |
if: steps.check-tag.outputs.IS_LATEST == 'true' | |
run: | | |
sudo apt install pandoc | |
pip install poetry | |
poetry --version | |
poetry config virtualenvs.in-project true | |
poetry install -vv | |
poetry install -E "docs all" | |
- name: Build docs | |
if: steps.check-tag.outputs.IS_LATEST == 'true' | |
run: | | |
cd docs | |
cp ../examples/*.ipynb source/tutorials | |
poetry run make clean ; poetry run make html | |
mv build/html/ ../site | |
env: | |
CI_COMMIT_SHORT_SHA: ${{ github.sha }} | |
WORKFLOW_NAME: ${{ github.workflow }} | |
- name: Deploy to Netlify | |
if: steps.check-tag.outputs.IS_LATEST == 'true' | |
uses: nwtgck/[email protected] | |
with: | |
publish-dir: './site' | |
production-branch: master | |
alias: ${{ github.event.release.prerelease && 'unstable' }} | |
production-deploy: ${{ !github.event.release.prerelease }} | |
deploy-message: "Deploy from GitHub Actions" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
enable-commit-comment: true | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
docker-build-and-push: | |
needs: publish | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dockerfile: | |
- {"name": etna-cpu, "path": docker/etna-cpu/Dockerfile} | |
- {"name": etna-cuda-11.6.2, "path": docker/etna-cuda-11.6.2/Dockerfile} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build image | |
run: | | |
cd $( dirname ${{ matrix.dockerfile.path }}) | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
sed -i "s#etna\[all\]#etna\[all\]==$VERSION#g" requirements.txt | |
cat requirements.txt | |
docker build . --tag image | |
- name: Log into registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Push image | |
run: | | |
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.dockerfile.name }} | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
echo IMAGE_ID=$IMAGE_ID | |
echo VERSION=$VERSION | |
docker tag image $IMAGE_ID:$VERSION | |
docker push $IMAGE_ID:$VERSION |