Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jul 18, 2024
1 parent 91af04f commit 78c1cab
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ permissions:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build_and_test_python:
if: false
strategy:
matrix:
python-version: ['3.11', '3.12']
Expand Down Expand Up @@ -74,3 +75,51 @@ jobs:
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@v3

- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
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@v6
with:
context: .
file: ./docker/Dockerfile
push: true
build-args: BASE_IMAGE=${{ env.BASE_IMAGE }}
tags: |
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
16 changes: 16 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ARG BASE_IMAGE
FROM --platform=$TARGETPLATFORM $BASE_IMAGE as build
LABEL maintainer="Maksym Sobolyev <[email protected]>"

USER root

# Set Environment Variables
ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /Infernos

# Build & install everything
RUN apt-get update
RUN apt-get install --no-install-recommends -y git lsb-release ca-certificates
COPY docker /Infernos/
RUN /Infernos/install_conda.sh
14 changes: 14 additions & 0 deletions docker/install_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -e
set -x

apt-get install --no-install-recommends -y curl gpg
curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > /tmp/conda.gpg
install -o root -g root -m 644 /tmp/conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg
rm /tmp/conda.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list

apt update
apt-get install --no-install-recommends -y conda

0 comments on commit 78c1cab

Please sign in to comment.