1.2.2 #16
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: Continuous Deployment | |
on: | |
release: | |
types: [published] | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ghcr.io | |
- name: Set tag name | |
id: tag | |
run: echo ::set-output name=tag_name::${GITHUB_REF#*\/*\/} | |
env: | |
GITHUB_REF: ${{ github.ref }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./docker/Dockerfile | |
push: true | |
tags: | | |
ghcr.io/artefactory/nlpretext:${{ steps.tag.outputs.tag_name }} | |
ghcr.io/artefactory/nlpretext:latest | |
cache-from: type=registry,ref=ghcr.io/artefactory/nlpretext:latest | |
cache-to: type=inline | |
- name: Scan image | |
uses: anchore/scan-action@v3 | |
id: scan | |
with: | |
image: "ghcr.io/artefactory/nlpretext:${{ steps.tag.outputs.tag_name }}" | |
acs-report-enable: true | |
- name: upload Anchore scan SARIF report | |
uses: github/codeql-action/upload-sarif@v1 | |
with: | |
sarif_file: ${{ steps.scan.outputs.sarif }} | |
documentation_and_package: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry and pandoc | |
run: | | |
sudo apt-get install pandoc | |
make download-poetry | |
- name: Set up cache | |
uses: actions/[email protected] | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} | |
- name: Set Poetry Path | |
run: | | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
poetry install -E torch | |
- name: Publish to PyPI | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
poetry config pypi-token.pypi $PYPI_TOKEN | |
poetry publish --build | |
- name: Run build script for Sphinx pages | |
run: | | |
source $(poetry env info | grep Path | awk '{ print $2 }')/bin/activate | |
git config --global user.name "Github-Pages Bot" | |
git config --global user.email "[email protected]" | |
sh docs/scripts/buildsite.sh | |
shell: bash |