Skip to content

Image workflows: don't push from PRs, and only rebuild what changed #6

Closed

Description

@jwinarske

Opening #5 showed a couple of problems with how the image workflows trigger.

  1. Pull requests push images. Every workflow runs docker-build-push on pull_request as well as on push to main, and the action pushes by default, so a PR republishes :main before it's merged. On ubuntu-24-dev: install iproute2 #5, ubuntu-24-user:main was replaced by an unreviewed build within a minute. Set pushImage: ${{ github.event_name != 'pull_request' }} so a PR only builds.

  2. Every change rebuilds every image. None of the workflows has a paths filter, so a one-line change to ubuntu-24-dev/Dockerfile rebuilds all eight images. Each rebuild runs apt-get upgrade (and, for some, llvm.sh), so images whose Dockerfiles didn't change still pick up new packages, and the dunfell/kirkstone/scarthgap CI that pulls them changes underneath. Add a paths filter to each workflow for its own directory and workflow file, e.g.

    on:
      push:
        branches: [main]
        paths:
          - 'ubuntu-24-dev/**'
          - '.github/workflows/ubuntu24-docker.yml'
  3. Old actions. actions/checkout@v3 and mr-smithers-excellent/docker-build-push@v5 target Node 20, which GitHub now forces onto Node 24 with a deprecation warning. Bump them while in here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions