Skip to content

Twiddle

Twiddle #15

name: nvidia-l4t-base
on:
push:
branches: [ main ]
paths:
- 'nvidia/l4t-base/**'
pull_request:
branches: [ main ]
paths:
- 'nvidia/l4t-base/**'
workflow_dispatch:
jobs:
build:
runs-on: [self-hosted]
defaults:
run:
working-directory: nvidia/l4t-base
steps:
- uses: actions/checkout@v4
- name: Install QEMU static binaries
uses: docker/setup-qemu-action@v3
# Intentionally not using docker/setup-bake, configured in Chef
- name: Login to DockerHub
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
- name: Build and push
uses: docker/bake-action@v4
with:
workdir: nvidia/l4t-base
push: ${{ github.event_name != 'pull_request' }}
- name: Get the image name
if: ${{ github.event_name != 'pull_request' }}
id: image_name
shell: bash
working-directory: nvidia/l4t-base
run: |
echo "image_name=$($(git rev-parse --show-toplevel)/bin/image-name.sh)" >> $GITHUB_ENV
- name: Get the image description
if: ${{ github.event_name != 'pull_request' }}
id: image_description
shell: bash
working-directory: nvidia/l4t-base
run: |
echo "image_description=$($(git rev-parse --show-toplevel)/bin/image-description.sh)" >> $GITHUB_ENV
- name: Get the image readme filepath
if: ${{ github.event_name != 'pull_request' }}
id: image_readme_filepath
shell: bash
working-directory: nvidia/l4t-base
run: |
echo "image_readme_filepath=$($(git rev-parse --show-toplevel)/bin/image-readme.sh)" >> $GITHUB_ENV
- name: Update Docker Hub Description
if: ${{ github.event_name != 'pull_request' }}
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_DESCRIPTION_PASSWORD }}
repository: boxcutter/${{ env.image_name }}
short-description: ${{ env.image_description }}
readme-filepath: ${{ env.image_readme_filepath }}