diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff337ce..42f467b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,9 +38,8 @@ jobs: - name: Set container name as output id: set_output run: | - BRANCH=$(echo "${GITHUB_REF}" | sed 's|refs/heads/||' | tr '[:upper:]' '[:lower:]') REPO=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]') - CONTAINER_NAME="ghcr.io/${REPO}/devcontainer:${BRANCH//\//-}" + CONTAINER_NAME="ghcr.io/${REPO}/devcontainer:main" echo "container_name=$CONTAINER_NAME" >> $GITHUB_OUTPUT echo "container_without_tag=ghcr.io/${REPO}/devcontainer" >> $GITHUB_OUTPUT @@ -49,17 +48,15 @@ jobs: with: context: .devcontainer file: .devcontainer/Dockerfile - push: true + push: ${{ github.ref == 'refs/heads/main' }} tags: ${{ steps.set_output.outputs.container_name }} - cache-from: | - type=registry,ref=${{ steps.set_output.outputs.container_name }}-cache - type=registry,ref=${{ steps.set_output.outputs.container_without_tag }}:main-cache + cache-from: type=registry,ref=${{ steps.set_output.outputs.container_name }}-cache cache-to: type=registry,ref=${{ steps.set_output.outputs.container_name }}-cache,mode=max test: name: Testing - needs: [container] runs-on: ubuntu-latest + needs: [container] container: image: ${{ needs.container.outputs.container_name }} permissions: @@ -88,8 +85,8 @@ jobs: fmt: name: Check formatting - needs: [container] runs-on: ubuntu-latest + needs: [container] container: image: ${{ needs.container.outputs.container_name }} steps: @@ -103,8 +100,8 @@ jobs: kani: name: Kani verification - needs: [container] runs-on: ubuntu-latest + needs: [container] container: image: ${{ needs.container.outputs.container_name }} steps: @@ -121,8 +118,8 @@ jobs: build-stm32-l4r5zi-def: name: Build for the STM32 Nucleo L4R5ZI - needs: [container] runs-on: ubuntu-latest + needs: [container] container: image: ${{ needs.container.outputs.container_name }} steps: