From 7cfa0caad493d135b8c27f71b98322c5ec14d814 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 28 Sep 2023 21:12:42 +0100 Subject: [PATCH 1/3] added github action --- .github/workflows/docker-build.yml | 62 ++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000..026d450d --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,62 @@ +name: Docker Image CI + +on: + push: + branches: [ humble ] + tags: + - '*' + pull_request: + branches: [ humble ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: What + run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Docker Login LCAS + # You may pin to the exact commit or the version. + # uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v2 + with: + # Server address of Docker registry. If not set then will default to Docker Hub + registry: lcas.lincoln.ac.uk + # Username used to log against the Docker registry + username: ${{ secrets.LCAS_REGISTRY_PUSHER }} + # Password or personal access token used to log against the Docker registry + password: ${{ secrets.LCAS_REGISTRY_TOKEN }} + - name: Docker Login dockerhub + uses: docker/login-action@v2 + with: + # Username used to log against the Docker registry + username: ${{ secrets.DOCKERHUB_USER }} + # Password or personal access token used to log against the Docker registry + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push limo_ros2 for arm64 + uses: docker/build-push-action@v5 + with: + context: .devcontainer + file: Dockerfile + platforms: linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: lcas.lincoln.ac.uk/lcas/limo_ros_arm64:${{ env.BRANCH }} + build-args: | + BRANCH=${{ env.BRANCH }} + - name: Build and push limo_ros2 for amd64 + uses: docker/build-push-action@v5 + with: + context: .devcontainer + file: Dockerfile + platforms: linux/amd64 + push: ${{ github.event_name != 'pull_request' }} + tags: lcas.lincoln.ac.uk/lcas/limo_ros_amd64:${{ env.BRANCH }} + build-args: | + BRANCH=${{ env.BRANCH }} + \ No newline at end of file From d768b5f5f0f77fbe6692bf8ebd026dcd1da96369 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 28 Sep 2023 21:17:03 +0100 Subject: [PATCH 2/3] corrected file path --- .github/workflows/docker-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 026d450d..ec57c5e2 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -43,7 +43,7 @@ jobs: uses: docker/build-push-action@v5 with: context: .devcontainer - file: Dockerfile + file: .devcontainer/Dockerfile platforms: linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: lcas.lincoln.ac.uk/lcas/limo_ros_arm64:${{ env.BRANCH }} @@ -53,7 +53,7 @@ jobs: uses: docker/build-push-action@v5 with: context: .devcontainer - file: Dockerfile + file: .devcontainer/Dockerfile platforms: linux/amd64 push: ${{ github.event_name != 'pull_request' }} tags: lcas.lincoln.ac.uk/lcas/limo_ros_amd64:${{ env.BRANCH }} From 873effb51698b5a41bc8ae7cd56bc81b1db65028 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 28 Sep 2023 21:22:52 +0100 Subject: [PATCH 3/3] login before qemu --- .github/workflows/docker-build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index ec57c5e2..832112a9 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -18,9 +18,6 @@ jobs: - uses: actions/checkout@v3 - name: What run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Docker Login LCAS # You may pin to the exact commit or the version. # uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 @@ -39,6 +36,8 @@ jobs: username: ${{ secrets.DOCKERHUB_USER }} # Password or personal access token used to log against the Docker registry password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Build and push limo_ros2 for arm64 uses: docker/build-push-action@v5 with: