Skip to content

Commit

Permalink
container v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
chrowe committed Jul 29, 2024
1 parent 07a8ee9 commit 2beecec
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .devcontainer/Dockerfile

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build-image
on:
push:
branches:
- main
paths:
- container/Containerfile
- container/VERSION
- environment.yml
jobs:
build-image:
name: build-image
runs-on: ubuntu-22.04
steps:
- name: Clean up Ubuntu
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get VERSION
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: wri-cities-cif-environment
tags: latest ${{ env.VERSION }} ${{ github.sha }}
containerfiles: |
./Containerfile
- name: Push image to container registry
id: push-image-to-registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/wri
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-image-to-registry.outputs.registry-paths }}"
8 changes: 8 additions & 0 deletions container/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM condaforge/miniforge3:latest
LABEL maintainer="Chris Rowe"
WORKDIR /src/
COPY environment.yml .
RUN true && \
mamba env create -f environment.yml && \
echo "source activate cities-cif" > "$HOME/.bashrc"
ENV PATH "/src:/opt/conda/envs/cities-cif/bin:$PATH"
1 change: 1 addition & 0 deletions container/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1

0 comments on commit 2beecec

Please sign in to comment.