From 42368cac9e5bf4792f921fc0b23e08b0dda0a9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gonz=C3=A1lez?= Date: Tue, 14 Nov 2023 12:15:56 +0000 Subject: [PATCH] ci.yml: Trigger docker image creation only on workflow_dispatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Simplify the docker creation process to avoid having to push a new commit with changes to the codebase. * Now it will only be necessary to trigger the CI workflow manually with the input 'parsec-service-test-all'. Signed-off-by: Tomás González --- .github/workflows/ci.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc7496ce..e6146555 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,19 +1,23 @@ name: Continuous Integration -on: [push, pull_request, workflow_dispatch] +on: + push: + pull_request: + workflow_dispatch: + inputs: + trigger_docker: + description: "'parsec-service-test-all' if docker build should be triggered" + required: false + default: "" env: - # TEST_ALL_DOCKER_IMAGE: 'parsec-service-test-all' - TEST_ALL_DOCKER_IMAGE: 'ghcr.io/parallaxsecond/parsec-service-test-all' + TEST_ALL_DOCKER_IMAGE: ${{ github.event.inputs.trigger_docker || 'ghcr.io/parallaxsecond/parsec-service-test-all' }} jobs: build-and-export-test-all-docker: runs-on: ubuntu-latest - # If TEST_ALL_DOCKER_IMAGE is 'parsec-service-test-all' or any local image, - # the following condition must evaluate true to execute this job - # Else it must evaluate false to NOT execute this job - # Unfortunately, env.TEST_ALL_DOCKER_IMAGE cannot be used here as the `env` context is not recognized at this level. - if: ${{ false }} # env.TEST_ALL_DOCKER_IMAGE == 'parsec-service-test-all' + # For running this job we need to manually trigger the CI and set the variable + if: ${{ github.event.inputs.trigger_docker == 'parsec-service-test-all' }} steps: - uses: actions/checkout@v3 - name: Build the docker container