Continuous Deployment #22
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] | |
workflow_dispatch: | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ghcr.io | |
- name: Set tag name | |
id: tag | |
run: echo "tag_name=${GITHUB_REF//\//-}" >> $GITHUB_OUTPUT | |
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 }}" | |
output-format: table | |
- 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@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
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 -E dask | |
# - 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: | | |
poetry run git config --global user.name "Github-Pages Bot" | |
poetry run git config --global user.email "[email protected]" | |
poetry run sh docs/scripts/buildsite.sh | |
shell: bash |