Jetson/Tegra Execution Engine releases #96
This file contains 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: Jetson/Tegra Execution Engine releases | |
on: | |
workflow_run: | |
workflows: ["PC/amd64 Execution Engine releases"] | |
types: | |
- completed | |
concurrency: | |
group: e2-release-process | |
cancel-in-progress: false | |
jobs: | |
on-failure: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
steps: | |
- run: | | |
echo "The triggering workflow failed" | |
exit 1 | |
handle-edge-device-rpi-releases: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Pull, tag, and push ARM64 Tegra images | |
run: | | |
# Parse the release.yaml file to extract versions | |
yq e '.application.envs[] | .name + ":" + (.version | tostring)' e2/release.yaml > temp_arm_tegra.yaml | |
ENVS=$(cat temp_arm_tegra.yaml) | |
echo "Recap step: attempting to process the following releases:" | |
echo "$ENVS" | |
echo "Processing step:" | |
echo "$ENVS" | while IFS=: read -r env version; do | |
version=${version//[[:space:]]/} # Trim whitespace from version | |
IMAGE="aixpand/exe_eng:tegra-$version" | |
NEW_TAG="aixpand/exe_eng:tegra_$env" | |
echo "##################################################" | |
echo "Environment: $env <- Version: $version" | |
echo "##################################################" | |
# Pull the specified version | |
echo "Pulling $IMAGE..." | |
if ! docker pull --platform=linux/arm64 $IMAGE; then | |
echo "Failed to pull image $IMAGE" | |
exit 1 | |
fi | |
# Tag and push the image with the environment tag | |
echo "Tagging $IMAGE as $NEW_TAG..." | |
docker tag $IMAGE $NEW_TAG | |
echo "Pushing $NEW_TAG..." | |
docker push $NEW_TAG | |
# Clean up the local Docker images to free up space | |
echo "Removing local Docker images..." | |
docker rmi $IMAGE | |
docker rmi $NEW_TAG | |
done | |
shell: bash | |
- name: Logout from Docker Hub | |
run: docker logout |