diff --git a/.github/actions/push-rti-docker/action.yml b/.github/actions/push-rti-docker/action.yml new file mode 100644 index 0000000000..3392882135 --- /dev/null +++ b/.github/actions/push-rti-docker/action.yml @@ -0,0 +1,36 @@ +name: Push RTI to Docker Hub +description: Build and push the RTI image to Docker Hub +inputs: + tag: + description: 'The tag of the RTI image to build and push' + required: true + default: 'latest' + DOCKERHUB_USERNAME: + description: 'The username to log in to Docker Hub' + required: true + DOCKERHUB_TOKEN: + description: 'The token to log in to Docker Hub' + required: true +runs: + using: "composite" + steps: + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ inputs.DOCKERHUB_USERNAME }} + password: ${{ inputs.DOCKERHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Check out lingua-franca repository + uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 + - name: Build and push + uses: docker/build-push-action@v6 + with: + file: ./core/src/main/resources/lib/c/reactor-c/core/federated/RTI/rti.Dockerfile + context: ./core/src/main/resources/lib/c/reactor-c + platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/riscv64 + push: true + tags: ${{ inputs.DOCKERHUB_USERNAME }}/rti:${{ inputs.tag }} diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 199f15ba23..c249dfe920 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -41,3 +41,9 @@ jobs: title: "Lingua Franca Nightly" files: | build/distributions/* + - name: Build and push RTI to Docker Hub + uses: ./.github/actions/push-rti-docker + with: + tag: nightly + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/rti-docker.yml b/.github/workflows/rti-docker.yml new file mode 100644 index 0000000000..4c300a8c24 --- /dev/null +++ b/.github/workflows/rti-docker.yml @@ -0,0 +1,23 @@ +name: Push RTI Image to Docker Hub + +on: + push: + branches: + - master + workflow_dispatch: +jobs: + build-and-push: + runs-on: ubuntu-latest + name: Build and push RTI to Docker Hub + steps: + - name: Check out lingua-franca repository + uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 + - name: Build and push RTI to Docker Hub + uses: ./.github/actions/push-rti-docker + with: + tag: master + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file