+ 91af04f8a8 #24
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
# This is a basic workflow to help you get started with Actions | |
name: Build, Test & Publush | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on all push or pull request events | |
push: | |
pull_request: | |
release: | |
types: [created] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
# added using https://github.com/step-security/secure-repo | |
permissions: | |
contents: read | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build_and_test_python: | |
strategy: | |
matrix: | |
python-version: ['3.11', '3.12'] | |
os: ['24.10'] | |
runs-on: ubuntu-latest | |
container: | |
image: ubuntu:${{ matrix.os }} | |
env: | |
PYTHON_CMD: "python${{ matrix.python-version }}" | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Install git | |
run: | | |
apt-get update | |
apt-get install --no-install-recommends -y git lsb-release ca-certificates | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
activate-environment: Infernos | |
- name: Conda init | |
run: conda init | |
- name: Conda list | |
run: | | |
. ~/miniconda3/etc/profile.d/conda.sh | |
conda activate Infernos | |
conda list | |
- name: Install dependencies | |
run: | | |
apt-get install --no-install-recommends -y gcc g++ libc6-dev cmake pkg-config make | |
. ~/miniconda3/etc/profile.d/conda.sh | |
conda activate Infernos | |
conda install -y pip | |
${PYTHON_CMD} -m pip install -U -r requirements.txt | |
- name: Preload models | |
run: | | |
. ~/miniconda3/etc/profile.d/conda.sh | |
conda activate Infernos | |
rm -rf ~/.cache | |
mkdir ~/.cache | |
python Infernos.py -f docker/preload_it_de.yaml | |
Docker: | |
name: Build&Push to DockerHub | |
if: (github.event_name == 'push' || github.event_name == 'pull_request') | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_REPO: sippylabs/infernos | |
PLATFORMS: linux/amd64 | |
BASE_IMAGE: ubuntu:24.10 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to Docker Hub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.DOCKER_REPO }} | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=tag | |
type=ref,event=pr | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=sha | |
- name: Build Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./docker/Dockerfile | |
build-args: BASE_IMAGE=${{ env.BASE_IMAGE }} | |
tags: | | |
${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |