From c516bc90e2da0d7ababcc5f3019562db5a80a41c Mon Sep 17 00:00:00 2001 From: Mischa Taylor Date: Sun, 5 Nov 2023 09:46:43 -0500 Subject: [PATCH] Add workflow for l4t-jetpack --- .github/workflows/l4t-jetpack-push.yml | 95 ++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/l4t-jetpack-push.yml diff --git a/.github/workflows/l4t-jetpack-push.yml b/.github/workflows/l4t-jetpack-push.yml new file mode 100644 index 00000000..b70c9f53 --- /dev/null +++ b/.github/workflows/l4t-jetpack-push.yml @@ -0,0 +1,95 @@ +name: l4t-base Merge +on: + push: + branches: [ main ] + paths: + - 'nvidia/l4t-jetpack/r35.4.1/**' + workflow_dispatch: + +jobs: + build: + runs-on: [self-hosted, linux, ARM64] + defaults: + run: + working-directory: 'nvidia/l4t-jetpack/r35.4.1' + steps: + - uses: actions/checkout@v4 + + - name: Check the Containerfile with hadolint + run: | + $(git rev-parse --show-toplevel)/bin/lint.sh + + - name: Install QEMU static binaries + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Set the tags + id: tags + run: | + echo "tags=$($(git rev-parse --show-toplevel)/bin/list-tags.sh -c)" >> $GITHUB_ENV + + - name: Set the test platform + id: test-platform + run: | + echo "test-platform=$($(git rev-parse --show-toplevel)/bin/list-platforms.sh | cut -d',' -f1)" >> $GITHUB_ENV + + - name: Build locally for testing + uses: docker/build-push-action@v5 + with: + load: true + context: nvidia/l4t-jetpack/r35.4.1 + file: nvidia/l4t-jetpack/r35.4.1/Containerfile + tags: ${{ env.tags }} + platforms: ${{ env.test-platform }} + + - name: Run tests on the image with cinc-auditor + run: | + $(git rev-parse --show-toplevel)/bin/test.sh + + - name: Set the platforms + id: platforms + run: | + echo "platforms=$($(git rev-parse --show-toplevel)/bin/list-platforms.sh -c)" >> $GITHUB_ENV + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} + password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + context: nvidia/l4t-jetpack/r35.4.1 + file: nvidia/l4t-jetpack/r35.4.1/Containerfile + platforms: ${{ env.platforms }} + tags: ${{ env.tags }} + env: + BUILDKIT_PROGRESS: plain + + - name: Set the image name + id: image_name + run: | + echo "image_name=$($(git rev-parse --show-toplevel)/bin/image-name.sh)" >> $GITHUB_ENV + + - name: Set the image description + id: image_description + run: | + echo "image_description=$($(git rev-parse --show-toplevel)/bin/image-description.sh)" >> $GITHUB_ENV + + - name: Set the image readme + id: image_readme + run: | + echo "image_readme=$($(git rev-parse --show-toplevel)/bin/image-readme.sh)" >> $GITHUB_ENV + + - name: Update Docker Hub Description + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} + password: ${{ secrets.CONTAINER_DESCRIPTION_PASSWORD }} + short-description: ${{ env.image_description }} + repository: polymathrobotics/${{ env.image_name }} + readme-filepath: ${{ env.image_readme }}