Skip to content

Commit

Permalink
ci: update docker workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
paradajz committed Nov 28, 2024
1 parent 4e706ab commit b5a290c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 14 deletions.
7 changes: 4 additions & 3 deletions .devcontainer/Dockerfile → .devcontainer/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM ubuntu:23.10
FROM ubuntu:24.04

ARG wget_args="-q --show-progress --progress=bar:force:noscroll"
ARG deps_dir=/opendeck-deps
ARG arduino_dir=${deps_dir}/arduino
ARG arduino_version=1.8.6
ARG dasel_version=1.27.3
ARG user=ubuntu
ARG workspace_dir=/home/${user}/workspace
ARG project_name=OpenDeck
Expand Down Expand Up @@ -78,7 +79,7 @@ echo "Unsupported architecture"; false; \
fi \
&& \
echo "Downloading dasel for $PACKAGE_VARIANT arch" && \
wget ${wget_args} https://github.com/TomWright/dasel/releases/download/v1.27.3/dasel_linux_${PACKAGE_VARIANT} -O dasel && \
wget ${wget_args} https://github.com/TomWright/dasel/releases/download/v${dasel_version}/dasel_linux_${PACKAGE_VARIANT} -O dasel && \
chmod +x dasel

RUN \
Expand All @@ -92,7 +93,7 @@ fi; \
cd ${deps_dir} && \
wget ${wget_args} \
-O nrfclt.deb \
https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-24-0/nrf-command-line-tools_10.24.0_${ARCH}.deb && \
https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-24-2/nrf-command-line-tools_10.24.2_${ARCH}.deb && \
dpkg -i nrfclt.deb && \
rm nrfclt.deb && \
echo '#!/bin/bash\necho not running udevadm "$@"' > /usr/bin/udevadm && chmod +x /usr/bin/udevadm && \
Expand Down
68 changes: 57 additions & 11 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@ name: Docker

on:
push:
branches:
- "*"
paths:
- 'west.yml'
- '.devcontainer/Dockerfile'
- '.devcontainer/Dockerfile.build'

jobs:
update_docker:
runs-on: ubuntu-22.04
x86-64:
name: Build Docker Container / x86-64
runs-on: ubuntu-latest
steps:
- name: Pull the repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
Expand All @@ -24,11 +21,60 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to docker hub
- name: Push to registry
uses: docker/build-push-action@v5
with:
push: true
context: .
platforms: linux/amd64, linux/arm64
file: .devcontainer/Dockerfile
tags: ghcr.io/shanteacontrols/opendeck:latest
platforms: linux/amd64
file: .devcontainer/Dockerfile.build
tags: |
ghcr.io/shanteacontrols/opendeck:${{ github.sha }}-x86-64
arm64:
name: Build Docker Container / arm64
runs-on: self-hosted
steps:
- name: Pull the repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to registry
uses: docker/build-push-action@v5
with:
push: true
context: .
platforms: linux/arm64
file: .devcontainer/Dockerfile.build
tags: |
ghcr.io/shanteacontrols/opendeck:${{ github.sha }}-arm64
create-manifests:
name: Create Docker manifests
runs-on: ubuntu-latest
needs: [x86-64, arm64]
steps:
- name: Pull the repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: SHA manifest
run: |
docker buildx imagetools create -t ghcr.io/shanteacontrols/opendeck:${{ github.sha }} \
ghcr.io/shanteacontrols/opendeck:${{ github.sha }}-x86-64 \
ghcr.io/shanteacontrols/opendeck:${{ github.sha }}-arm64
- name: latest manifest
run: |
docker buildx imagetools create -t ghcr.io/shanteacontrols/opendeck:latest \
ghcr.io/shanteacontrols/opendeck:${{ github.sha }}-x86-64 \
ghcr.io/shanteacontrols/opendeck:${{ github.sha }}-arm64

0 comments on commit b5a290c

Please sign in to comment.