Create CI to build & push PyBaMM's Docker Images #3
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: Build & Push Docker Images | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
pre_job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: List built images | |
run: docker images | |
- name: Build and Push Docker Image (Without Solvers) | |
env: | |
IMAGE_NAME: pybamm/pybamm:latest | |
run: | | |
docker build -t $IMAGE_NAME -f scripts/Dockerfile . | |
docker push $IMAGE_NAME | |
- name: Build and Push Docker Image (With JAX Solver) | |
env: | |
IMAGE_NAME: pybamm/pybamm:jax | |
ARG_NAME: JAX | |
run: | | |
docker build -t $IMAGE_NAME -f scripts/Dockerfile --build-arg $ARG_NAME=true . | |
docker push $IMAGE_NAME | |
- name: Build and Push Docker Image (With ODES & DAE Solver) | |
env: | |
IMAGE_NAME: pybamm/pybamm:odes | |
ARG_NAME: ODES | |
run: | | |
docker build -t $IMAGE_NAME -f scripts/Dockerfile --build-arg $ARG_NAME=true . | |
docker push $IMAGE_NAME | |
- name: Build and Push Docker Image (With IDAKLU Solver) | |
env: | |
IMAGE_NAME: pybamm/pybamm:idaklu | |
ARG_NAME: IDAKLU | |
run: | | |
docker build -t $IMAGE_NAME -f scripts/Dockerfile --build-arg $ARG_NAME=true . | |
docker push $IMAGE_NAME | |
- name: Build and Push Docker Image (With All Solvers) | |
env: | |
IMAGE_NAME: pybamm/pybamm:all | |
ARG_NAME: ALL | |
run: | | |
docker build -t $IMAGE_NAME -f scripts/Dockerfile --build-arg $ARG_NAME=true . | |
docker push $IMAGE_NAME |