Skip to content

Commit

Permalink
Adds building other containers
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonb5 committed Mar 9, 2024
1 parent 1acc458 commit 7301239
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,56 @@ jobs:
push: true
tags: ghcr.io/esgf-nimbus/climate-notebook-gpu:${{ steps.get-version.outputs.version }}
build-args: "${{ steps.get-version.outputs.build-args }}"

other-containers:
runs-on: ubuntu-latest
name: Get other containers
outputs:
directories: "${{ steps.get-paths.outputs.directories }}"
steps:
- uses: actions/checkout@v4
- id: get-paths
run: |
CONTAINERS="$(ls dockerfiles/ | grep -v -E "Makefile|climate*|minimal" | jq -R -s -c 'split("\n")[:-1]')"
echo "directories=$CONTAINERS" >> $GITHUB_OUTPUT
build-other-containers:
needs:
- get-issue-number
- other-containers
runs-on: ubuntu-latest
name: Build other containers
permissions:
packages: write
strategy:
matrix:
directory: ${{ fromJSON(needs.other-containers.outputs.directories) }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- id: get-version
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
VERSION=pr-${{ needs.get-issue-number.outputs.pr-number }}
echo "version=$VERSION" >> $GITHUB_OUTPUT
else
pip install tbump
pushd dockerfiles/${{ matrix.directory }}
echo "version=$(tbump current-version)" >> $GITHUB_OUTPUT
fi
- uses: docker/build-push-action@v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: dockerfiles/${{ matrix.directory }}
push: true
tags: ghcr.io/esgf-nimbus/${{ matrix.directory }}:${{ steps.get-version.outputs.version }}

0 comments on commit 7301239

Please sign in to comment.