[DLS] [U22] Build weekly deb img (by nszczygl9) #9
Workflow file for this run
This file contains hidden or 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: "[DLS] [U22] Build weekly deb img" | |
| run-name: "[DLS] [U22] Build weekly deb img (by ${{ github.actor }})" | |
| on: | |
| push: | |
| branches: | |
| - 'build-deb-packages' | |
| # paths: | |
| # - 'libraries/dl-streamer/**' | |
| # pull_request: | |
| # paths: | |
| # - 'libraries/dl-streamer/**' | |
| permissions: | |
| packages: write | |
| contents: read | |
| jobs: | |
| build-dls-image: | |
| name: Build ${{ matrix.ubuntu_version }} .deb | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - ubuntu_version: ubuntu22 | |
| outputs: | |
| image: ${{ steps.save-image.outputs.image }} | |
| steps: | |
| - name: Check out edge-ai-libraries repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2 | |
| with: | |
| path: edge-ai-libraries-repo | |
| - name: Init submodules | |
| run: | | |
| cd edge-ai-libraries-repo | |
| git submodule update --init libraries/dl-streamer/thirdparty/spdlog | |
| - name: Build deb packages | |
| run: | | |
| chmod +x edge-ai-libraries-repo/libraries/dl-streamer/scripts/build_deb_packages.sh | |
| cd edge-ai-libraries-repo/libraries/dl-streamer | |
| echo "y" | ./scripts/build_deb_packages.sh --ubuntu_version=${{ matrix.ubuntu_version }} | |
| - name: Check for .deb package | |
| run: | | |
| if ls edge-ai-libraries-repo/libraries/dl-streamer/deb_packages/*.deb 1> /dev/null 2>&1; then | |
| echo "Deb package found." | |
| else | |
| echo "No deb package found." | |
| exit 1 | |
| fi | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #3.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Binary image | |
| run: | | |
| docker build -t ghcr.io/${{ github.repository }}/dls-deb-${{ matrix.ubuntu_version }}:dls-latest -f ./edge-ai-libraries-repo/libraries/dl-streamer/docker/onebinary/${{ matrix.ubuntu_version }}/dlstreamer_${{ matrix.ubuntu_version }}.Dockerfile . | |
| - name: Push Docker image | |
| run: | | |
| docker push ghcr.io/${{ github.repository }}/dls-deb-${{ matrix.ubuntu_version }}:dls-latest | |
| - name: Save image info | |
| id: save-image | |
| run: echo "image=ghcr.io/${{ github.repository }}/dls-deb-${{ matrix.ubuntu_version }}:dls-latest" >> "$GITHUB_OUTPUT" | |
| - name: Create summary | |
| if: always() | |
| run: | | |
| echo "### Dls Docker ${{ matrix.image }} :ship:" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "${{ steps.save-image.outputs.image }}" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "Built on commit id: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY | |
| - name: Clean up | |
| if: always() | |
| run: | | |
| rm -rf edge-ai-libraries-repo | |
| docker rmi ghcr.io/${{ github.repository }}/dls-deb-${{ matrix.ubuntu_version }}:dls-latest || true | |
| build-dls-pipeline-server-image: | |
| needs: build-dls-image | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - ubuntu_version: ubuntu22 | |
| steps: | |
| - name: Check out edge-ai-libraries repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2 | |
| with: | |
| path: edge-ai-libraries-repo | |
| - name: Init submodules | |
| run: | | |
| cd edge-ai-libraries-repo | |
| git submodule update --init libraries/dl-streamer/thirdparty/spdlog | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #3.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build dls-pipeline-server-image using dls-image as base image | |
| run: | | |
| cd edge-ai-libraries-repo/microservices/dlstreamer-pipeline-server/docker | |
| export BASE_IMAGE=${{ needs.build-dls-image.outputs.image }} | |
| export PIPELINE_SERVER_IMAGE=ghcr.io/${{ github.repository }}/dls-pipeline-server-deb-${{ matrix.ubuntu_version }}:dls-pipeline-server-latest | |
| docker compose build --no-cache --pull | |
| - name: Push Docker image | |
| run: | | |
| docker push ghcr.io/${{ github.repository }}/dls-pipeline-server-deb-${{ matrix.ubuntu_version }}:dls-pipeline-server-latest | |
| - name: Save image info | |
| id: save-image | |
| run: echo "image=ghcr.io/${{ github.repository }}/dls-pipeline-server-deb-${{ matrix.ubuntu_version }}:dls-pipeline-server-latest " >> $GITHUB_ENV | |
| - name: Create summary | |
| if: always() | |
| run: | | |
| echo "### Dls-pipeline-server Docker ${{ matrix.ubuntu_version }} :ship:" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "${{ env.image }}" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "Built on commit id: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY | |
| - name: Clean up | |
| if: always() | |
| run: | | |
| rm -rf edge-ai-libraries-repo | |
| docker rmi ghcr.io/${{ github.repository }}/dls-pipeline-server-deb-${{ matrix.ubuntu_version }}:dls-pipeline-server-latest || true |