Add ros1 image variants #7
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: Deploy Opensource Image to GHCR | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
generate_matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: "Checkout GitHub Action" | |
uses: actions/checkout@v4 | |
- name: "Parse images.json" | |
id: set-matrix | |
run: | | |
tr --delete ' ' < .github/workflows/ci_images.json > .github/workflows/ci_images_nospace.json | |
tr --delete '\n' < .github/workflows/ci_images_nospace.json > .github/workflows/ci_images_oneline.json | |
echo "matrix=$(cat .github/workflows/ci_images_oneline.json)" >> $GITHUB_OUTPUT | |
build: | |
needs: generate_matrix | |
runs-on: ubuntu-latest | |
permissions: write-all | |
strategy: | |
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix)}} | |
fail-fast: false | |
steps: | |
- name: "Checkout GitHub Action" | |
uses: actions/checkout@v4 | |
- name: "Login to GitHub Container Registry" | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Build the Docker images" | |
run: | | |
echo "Building ${{ matrix.TAG }}" | |
IMAGE_TAG="ghcr.io/simonschwaiger/ros-ml-container:${{ matrix.TAG }}" | |
mkdir src | |
echo "jupyterlab" > requirements.txt | |
docker build . --file baseimages/${{ matrix.BASE_DOCKERFILE }} --tag ros_ml_container:baseimage --build-arg BASEIMAGE=${{ matrix.BASEIMAGE }} --build-arg ROS_DISTRO=${{ matrix.ROS_DISTRO }} --build-arg PYTHONVER=${{ matrix.PYTHONVER }} | |
docker build . --file .github/workflows/${{ matrix.DOCKERFILE }} --tag $IMAGE_TAG --build-arg BASEIMAGE=${{ matrix.BASEIMAGE }} --build-arg ROS_DISTRO=${{ matrix.ROS_DISTRO }} --build-arg PYTHONVER=${{ matrix.PYTHONVER }} | |
docker push $IMAGE_TAG |