etna 2.6.0 #5
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-package: | |
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.10" | |
- 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-package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-docs-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: | | |
poetry install -E "all docs" -vv | |
- name: Install apt docs dependencies | |
run: | | |
sudo apt install pandoc | |
sudo apt install s3cmd | |
- name: Build docs | |
run: | | |
cd docs | |
poetry run make build-docs | |
mv build/html/ ../site | |
env: | |
CI_COMMIT_SHORT_SHA: ${{ github.sha }} | |
WORKFLOW_NAME: ${{ github.workflow }} | |
- name: Deploy to s3 | |
run: | | |
echo "${{ secrets.DOCS_S3CMD_CONFIG }}" > .s3cfg | |
s3cmd -c .s3cfg rm -r "s3://docs.etna.ai/stable/" | |
s3cmd -c .s3cfg put --recursive --guess-mime-type --no-mime-magic ./site/ "s3://docs.etna.ai/stable/" | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
s3cmd -c .s3cfg rm -r "s3://docs.etna.ai/$VERSION/" | |
s3cmd -c .s3cfg put --recursive --guess-mime-type --no-mime-magic ./site/ "s3://docs.etna.ai/$VERSION/" | |
docker-build-and-push: | |
needs: publish-package | |
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: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Install dependencies | |
run: | | |
poetry install -E all -vv | |
- name: Build image | |
run: | | |
cd $( dirname ${{ matrix.dockerfile.path }}) | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
echo "etna[all]==$VERSION" > requirements.txt | |
poetry export -E "all jupyter" --without-hashes --format=requirements.txt >> 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 |