lichess-bot-devs / lichess-bot

A bridge between Lichess bots and chess engines
GNU Affero General Public License v3.0
715 stars 434 forks source link

Remove file change condition #949

Closed AttackingOrDefending closed 2 months ago

AttackingOrDefending commented 2 months ago

Type of pull request:

Description:

Since the commit is made thorugh github actions, github doesn't rerun the workflows, so the docker is not built.

Related Issues:

Related to #936

Checklist:

Screenshots/logs (if applicable):

fathzer commented 2 months ago

Hi,

Maybe adding /.github/workflows/docker.yml is better than removing the whole file condition?

The idea behind this file condition is a first step to prevent several strictly identical images with different version numbers. It Assumes that the lib/versioning.yml is a safe way to track new versions. Unfortunately, if I understand correctly how the versioning.yml workflow works, it is currently not: A new version number is generated each time there's a push into the master branch, even if it is a correction in the wiki.

Nevertheless, if the file condition remains, it simply remains to fix the versioning.yml action to prevent incrementing lib/versioning.yml when nothing changes in the application (probably with an appropriate file condition on versioning.yml workflow).

But maybe I'm wrong about the meaning of lib/versioning.yml?

fathzer commented 2 months ago

Maybe adding /.github/workflows/docker.yml is better than removing the whole file condition?

Ooops, this will not work, as it seems the push made by versioning workflow does not trigger any workflow (Sorry, I tested it changing myself the lib/versioning.yml file). I will test a solution based on versioning workflow completion ...

fathzer commented 2 months ago

In order to have docker CI running when Versioning succeeds, you should replace the following in docker.yml:

on:
  push:
    branches:
      - master
    paths:
      - lib/versioning.yml

env:
  GB_REGISTRY: ghcr.io

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

by this:

on:
  workflow_run:
    workflows: ["Versioning"]
    types:
      - completed

env:
  GB_REGISTRY: ghcr.io

jobs:
  build:
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    steps:
      - uses: actions/checkout@v4

Warning:

AttackingOrDefending commented 2 months ago

I implemented your change. I removed the quotes because the examples in the docs didn't have them.

MarkZH commented 2 months ago

Ready to merge?

AttackingOrDefending commented 2 months ago

Yes.