Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,53 @@ on:
workflow_dispatch:

jobs:
check-secret:
runs-on: ubuntu-latest
outputs:
secret-configured: ${{ steps.secret-exists-check.outputs.defined }}
steps:
- name: Check if Secret is configured
id: secret-exists-check
# check if the secrets are configured before running the tasks
# see: https://stackoverflow.com/a/70249520
shell: bash
run: |
if [ "${{ secrets.DOCKER_REGISTRY }}" != '' ]; then
echo "defined=true" >> $GITHUB_OUTPUT;
else
echo "defined=false" >> $GITHUB_OUTPUT;
fi

build-test:
name: Build and Test
runs-on: ubuntu-latest
needs: [check-secret]
env:
RIOT_BRANCH: '2026.04-branch'
VERSION_TAG: '2026.07'
DOCKER_REGISTRY: "${{ secrets.DOCKER_REGISTRY || 'local' }}"

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@main
Comment thread
crasbe marked this conversation as resolved.
with:
lfs: 'true'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v4
with:
driver: docker

- name: Build riotdocker-base
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7
with:
context: ./riotdocker-base
tags: |
${{ env.DOCKER_REGISTRY }}/riotdocker-base:latest
${{ env.DOCKER_REGISTRY }}/riotdocker-base:${{ env.VERSION_TAG }}

- name: Build static-test-tools
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7
with:
context: ./static-test-tools
tags: |
Expand All @@ -77,7 +95,7 @@ jobs:
echo "RIOTBUILD_VERSION=$(git describe --always)" >> $GITHUB_ENV

- name: Build riotbuild
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7
with:
context: ./riotbuild
tags: |
Expand All @@ -90,7 +108,7 @@ jobs:
RIOTBUILD_VERSION=${{ env.RIOTBUILD_VERSION }}

- name: Checkout RIOT
uses: actions/checkout@v2
uses: actions/checkout@main
with:
repository: RIOT-OS/RIOT
ref: ${{ env.RIOT_BRANCH }}
Expand Down Expand Up @@ -173,7 +191,7 @@ jobs:
./dist/tools/ci/static_tests.sh

- name: Build murdock worker
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7
with:
context: ./murdock-worker
tags: |
Expand All @@ -183,14 +201,14 @@ jobs:
DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }}

- name: Login to DockerHub
if: "${{ github.ref == 'refs/heads/master' }}"
uses: docker/login-action@v1
if: "${{ github.ref == 'refs/heads/master' && needs.check-secret.outputs.secret-configured == 'true' }}"
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push Images
if: "${{ github.ref == 'refs/heads/master' }}"
if: "${{ github.ref == 'refs/heads/master' && needs.check-secret.outputs.secret-configured == 'true' }}"
run: |
docker image push ${{ env.DOCKER_REGISTRY }}/riotdocker-base:latest
docker image push ${{ env.DOCKER_REGISTRY }}/riotdocker-base:${{ env.VERSION_TAG }}
Expand Down