Skip to content

Commit

Permalink
ci: add dev image deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
lkstrp committed Nov 28, 2024
1 parent 728eacf commit 5194c71
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/deploy-dev-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy dev-env image

on:
push:
paths:
- envs/linux-pinned.yaml
workflow_dispatch:

jobs:
push-image:
name: Push dev-env image
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}

- name: 'Build Inventory Image'
run: |
docker build . --tag ghcr.io/${{ github.repository_owner }}/eur-dev-env:latest --file docker/dev-env/Dockerfile
docker push ghcr.io/${{ github.repository_owner }}/eur-dev-env:latest
26 changes: 26 additions & 0 deletions docker/dev-env/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM condaforge/mambaforge

RUN conda update -n base conda
RUN conda install -n base conda-libmamba-solver
RUN conda config --set solver libmamba

RUN apt-get update && apt-get install -y bash git make

RUN conda --version

WORKDIR /pypsa-eur

COPY ./envs ./temp

RUN conda env create -n pypsa-eur -f temp/environment.yaml
RUN conda init bash
RUN echo "conda activate pypsa-eur" >> ~/.bashrc

SHELL ["/bin/bash", "--login", "-c"]
ENV PATH=/opt/conda/envs/pypsa-eur/bin:$PATH

RUN rm -r temp
RUN conda clean -afy && \
rm -rf /tmp/*

CMD ["bash"]

0 comments on commit 5194c71

Please sign in to comment.