From 407134bab1b560bbb37cb9b2af624b76e89caa74 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 21 Jan 2023 09:57:35 +0100 Subject: [PATCH] Extract docker image building during CI to its own workflow --- .github/workflows/ci-docker-image-build.yml | 14 ++++++++ .github/workflows/ci.yml | 34 +++++++++---------- ...age-build.yml => publish-docker-image.yml} | 8 +++++ LICENSE | 2 +- 4 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/ci-docker-image-build.yml rename .github/workflows/{docker-image-build.yml => publish-docker-image.yml} (82%) diff --git a/.github/workflows/ci-docker-image-build.yml b/.github/workflows/ci-docker-image-build.yml new file mode 100644 index 00000000..690a365d --- /dev/null +++ b/.github/workflows/ci-docker-image-build.yml @@ -0,0 +1,14 @@ +name: Build docker image + +on: + pull_request: + paths: + - './Dockerfile' + +jobs: + build-docker-image: + runs-on: ubuntu-22.04 + steps: + - name: Checkout code + uses: actions/checkout@v3 + - run: docker build -t shlink-docker-image:temp . diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca34c07d..a95f8f21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,28 @@ name: Continuous integration on: - pull_request: null + pull_request: + paths-ignore: + - 'LICENSE' + - './.*' + - './*.md' + - './*.xml' + - './*.yml*' + - './*.json5' + - './*.neon' push: branches: - main - develop - 2.x + paths-ignore: + - 'LICENSE' + - './.*' + - './*.md' + - './*.xml' + - './*.yml*' + - './*.json5' + - './*.neon' jobs: static-analysis: @@ -157,19 +173,3 @@ jobs: coverage-db coverage-api coverage-cli - - build-docker-image: - runs-on: ubuntu-22.04 - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 100 - - uses: marceloprado/has-changed-path@v1 - id: changed-dockerfile - with: - paths: ./Dockerfile - - if: ${{ steps.changed-dockerfile.outputs.changed == 'true' }} - run: docker build -t shlink-docker-image:temp . - - if: ${{ steps.changed-dockerfile.outputs.changed != 'true' }} - run: echo "Dockerfile didn't change. Skipped" diff --git a/.github/workflows/docker-image-build.yml b/.github/workflows/publish-docker-image.yml similarity index 82% rename from .github/workflows/docker-image-build.yml rename to .github/workflows/publish-docker-image.yml index 9eb682d6..2842f505 100644 --- a/.github/workflows/docker-image-build.yml +++ b/.github/workflows/publish-docker-image.yml @@ -4,6 +4,14 @@ on: push: branches: - develop + paths-ignore: + - 'LICENSE' + - './.*' + - './*.md' + - './*.xml' + - './*.yml*' + - './*.json5' + - './*.neon' tags: - 'v*' diff --git a/LICENSE b/LICENSE index 2a381d83..c245a4e0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016-2021 Alejandro Celaya +Copyright (c) 2016-2023 Alejandro Celaya Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal