Skip to content

Test matrix autoformatting #3

Test matrix autoformatting

Test matrix autoformatting #3

Workflow file for this run

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 ' ' < ci_images.json > ci_images_nospace.json

Check failure on line 23 in .github/workflows/ci_unified.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci_unified.yaml

Invalid workflow file

You have an error in your yaml syntax on line 23
tr --delete '\n' < ci_images_nospace.json > 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@v1
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 .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