Merge pull request #17 from scottcoughlin2014/main #47
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: ci | |
on: | |
push: | |
branches: | |
- "main" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set short SHA | |
id: vars | |
run: echo "sha_short=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT | |
- name: Check SHA value | |
run: echo ${{ steps.vars.outputs.sha_short }} | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: "lab:latest" | |
driver: cloud | |
endpoint: "nuitrcs/bob-the-builder" | |
- name: Evaluate which Dockerfiles have changed | |
uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: | | |
cellprofiler: | |
- 'cellprofiler/Dockerfile' | |
projectchrono-deps: | |
- 'projectchrono-deps/Dockerfile' | |
mcribs: | |
- 'M-CRIB-S/Dockerfile' | |
llama: | |
- 'llama-cpp-python/Dockerfile' | |
sasview: | |
- 'sasview/Dockerfile.ubuntu2204' | |
simpson: | |
- 'SIMPSON/Dockerfile' | |
- name: Build and push cellprofiler | |
if: steps.changes.outputs.cellprofiler == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:cellprofiler" | |
tags: nuitrcs/cellprofiler:${{ steps.vars.outputs.sha_short }} | |
# For pull requests, export results to the build cache. | |
# Otherwise, push to a registry. | |
outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} | |
- name: Build and push project chrono | |
if: steps.changes.outputs.projectchrono-deps == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:projectchrono-deps" | |
tags: nuitrcs/projectchrono-deps:${{ steps.vars.outputs.sha_short }} | |
# For pull requests, export results to the build cache. | |
# Otherwise, push to a registry. | |
outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} | |
- name: Build and push M-CRIB-S | |
if: steps.changes.outputs.mcribs == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:M-CRIB-S" | |
tags: nuitrcs/m-crib-s:${{ steps.vars.outputs.sha_short }} | |
# For pull requests, export results to the build cache. | |
# Otherwise, push to a registry. | |
outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} | |
- name: Build and push llama | |
if: steps.changes.outputs.llama == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:llama-cpp-python" | |
tags: nuitrcs/llama-cpp-python:${{ steps.vars.outputs.sha_short }} | |
# For pull requests, export results to the build cache. | |
# Otherwise, push to a registry. | |
outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} | |
- name: Build and sasview | |
if: steps.changes.outputs.sasview == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:sasview" | |
tags: nuitrcs/sasview:${{ steps.vars.outputs.sha_short }} | |
file: Dockerfile.ubuntu2204 | |
# For pull requests, export results to the build cache. | |
# Otherwise, push to a registry. | |
outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} | |
- name: Build and push SIMPSON | |
if: steps.changes.outputs.simpson == 'true' | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}:SIMPSON" | |
tags: nuitrcs/simpson:${{ steps.vars.outputs.sha_short }} | |
file: Dockerfile | |
# For pull requests, export results to the build cache. | |
# Otherwise, push to a registry. | |
outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} | |