From da703f55360c96640a42d95ba533a138d77415c7 Mon Sep 17 00:00:00 2001
From: Emmanuel Bruno <emmanuel.bruno@univ-tln.fr>
Date: Wed, 29 Mar 2023 16:47:12 +0200
Subject: [PATCH] fixes baremetal CI.

---
 .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e5da39c..13ad49a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,21 +1,17 @@
 name: ci
 
 on:
+  workflow_dispatch:  
   push:
     branches:
       - 'releases/v*'
       - 'develop'
     tags:
       - 'v*.*.*'
-  workflow_dispatch:
-
 
 jobs:
   docker:
-    strategy:
-      matrix:
-        platform: ["linux/amd64","linux/arm64/v8"]
-    runs-on: [self-hosted, "${{ matrix.platform }}"]
+    runs-on: [self-hosted, multiarch]
     steps:
       - name: Checkout
         uses: actions/checkout@v3
@@ -33,26 +29,44 @@ jobs:
             type=semver,pattern={{version}}
             type=semver,pattern={{major}}.{{minor}}
             type=semver,pattern={{major}}
+          labels: |
+            org.opencontainers.image.description=A test for Docker CI with Github Actions.            
       - name: Login to DockerHub
         if: github.event_name != 'pull_request'
         uses: docker/login-action@v2
         with:
           username: ${{ secrets.DOCKERHUB_USERNAME }}
           password: ${{ secrets.DOCKERHUB_TOKEN }}
-      #- name: Set up QEMU
-      #  uses: docker/setup-qemu-action@v2
+      - uses: webfactory/ssh-agent@v0.7.0
+        with:
+          ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v2
-        with:
-           driver: docker           
-#          driver: docker-container
-#          driver-opts: |
-#           network=host
+        with:        
+          driver-opts: |
+            network=host
+          buildkitd-flags: |
+            --debug 
+            --allow-insecure-entitlement network.host
+            --allow-insecure-entitlement security.insecure            
+          endpoint: ssh://bruno@pc-bruno-gpu
+          platforms: linux/amd64
+          append: |
+            - endpoint: ssh://bruno@mbp-bruno
+              platforms: linux/arm64/v8
       - name: Build and push
         uses: docker/build-push-action@v4
         with:
           context: .
-          # platforms: ${{ matrix.platform }}
+          platforms: |
+            linux/amd64
+            linux/arm64/v8
           push: ${{ github.event_name != 'pull_request' }}
           tags: ${{ steps.meta.outputs.tags }}
           labels: ${{ steps.meta.outputs.labels }}
+      - name: Update repo description
+        uses: peter-evans/dockerhub-description@v3
+        with:
+          username: ${{ secrets.DOCKERHUB_USERNAME }}
+          password: ${{ secrets.DOCKERHUB_TOKEN }}
+          repository: "${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOSITORY_NAME }}"          
-- 
GitLab