diff --git a/.github/workflows/dockers-agent-ngt-image.yml b/.github/workflows/dockers-agent-ngt-image.yml index 5f75f9073f..bcc2136fdc 100644 --- a/.github/workflows/dockers-agent-ngt-image.yml +++ b/.github/workflows/dockers-agent-ngt-image.yml @@ -54,24 +54,42 @@ on: - "dockers/agent/core/ngt/Dockerfile" - "versions/GO_VERSION" - "versions/NGT_VERSION" + pull_request_target: + types: [labeled] + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-agent-ngt-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/db/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/agent/core/ngt/**" + - "cmd/agent/core/ngt/**" + - "dockers/agent/core/ngt/Dockerfile" + - "versions/GO_VERSION" + - "versions/NGT_VERSION" jobs: build: strategy: max-parallel: 4 runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} steps: - uses: actions/checkout@v3 - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 with: platforms: all - name: Setup Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: "--debug" - name: Login to DockerHub diff --git a/.github/workflows/dockers-agent-sidecar-image.yml b/.github/workflows/dockers-agent-sidecar-image.yml index 95dbdacca5..cd8ad024e8 100644 --- a/.github/workflows/dockers-agent-sidecar-image.yml +++ b/.github/workflows/dockers-agent-sidecar-image.yml @@ -54,24 +54,42 @@ on: - "cmd/agent/sidecar/**" - "dockers/agent/sidecar/Dockerfile" - "versions/GO_VERSION" + pull_request_target: + types: [labeled] + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-agent-sidecar-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/db/**" + - "internal/db/storage/blob/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/agent/sidecar/**" + - "cmd/agent/sidecar/**" + - "dockers/agent/sidecar/Dockerfile" + - "versions/GO_VERSION" jobs: build: strategy: max-parallel: 4 runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} steps: - uses: actions/checkout@v3 - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 with: platforms: all - name: Setup Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: "--debug" - name: Login to DockerHub diff --git a/.github/workflows/dockers-ci-container-image.yml b/.github/workflows/dockers-ci-container-image.yml index 62250794bb..1b54d86c98 100644 --- a/.github/workflows/dockers-ci-container-image.yml +++ b/.github/workflows/dockers-ci-container-image.yml @@ -35,24 +35,35 @@ on: - "Makefile.d/**" - "versions/GO_VERSION" - "versions/NGT_VERSION" + pull_request_target: + types: [labeled] + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-ci-container-image.yml" + - "dockers/ci/**" + - "Makefile" + - "Makefile.d/**" + - "versions/GO_VERSION" + - "versions/NGT_VERSION" jobs: build: strategy: max-parallel: 4 runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} steps: - uses: actions/checkout@v3 - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 with: platforms: all - name: Setup Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: "--debug" - name: Login to DockerHub diff --git a/.github/workflows/dockers-dev-container-image.yml b/.github/workflows/dockers-dev-container-image.yml index 1b213168a2..f8d6bd2e55 100644 --- a/.github/workflows/dockers-dev-container-image.yml +++ b/.github/workflows/dockers-dev-container-image.yml @@ -29,6 +29,13 @@ on: - ".github/workflows/dockers-dev-container-image.yml" - "dockers/ci/**" - "dockers/dev/**" + pull_request_target: + types: [labeled] + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-dev-container-image.yml" + - "dockers/ci/**" + - "dockers/dev/**" schedule: - cron: "0 1 * * *" @@ -37,18 +44,19 @@ jobs: strategy: max-parallel: 4 runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} steps: - uses: actions/checkout@v3 - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 with: platforms: all - name: Setup Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: "--debug" - name: Login to DockerHub diff --git a/.github/workflows/dockers-discoverer-k8s-image.yml b/.github/workflows/dockers-discoverer-k8s-image.yml index 4cf3037aa9..aeaa56bd72 100644 --- a/.github/workflows/dockers-discoverer-k8s-image.yml +++ b/.github/workflows/dockers-discoverer-k8s-image.yml @@ -50,24 +50,40 @@ on: - "cmd/discoverer/k8s/**" - "dockers/discoverer/k8s/Dockerfile" - "versions/GO_VERSION" + pull_request_target: + types: [labeled] + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-discoverer-k8s-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/db/**" + - "apis/grpc/**" + - "pkg/discoverer/k8s/**" + - "cmd/discoverer/k8s/**" + - "dockers/discoverer/k8s/Dockerfile" + - "versions/GO_VERSION" jobs: build: strategy: max-parallel: 4 runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} steps: - uses: actions/checkout@v3 - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 with: platforms: all - name: Setup Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: "--debug" - name: Login to DockerHub diff --git a/.github/workflows/dockers-gateway-filter-image.yml b/.github/workflows/dockers-gateway-filter-image.yml index d4855dbe15..00c6efb0fa 100644 --- a/.github/workflows/dockers-gateway-filter-image.yml +++ b/.github/workflows/dockers-gateway-filter-image.yml @@ -56,24 +56,43 @@ on: - "pkg/gateway/internal/**" - "dockers/gateway/filter/Dockerfile" - "versions/GO_VERSION" + pull_request_target: + types: [labeled] + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-gateway-filter-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/**/*_mock.go" + - "!internal/db/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/gateway/filter/**" + - "cmd/gateway/filter/**" + - "pkg/gateway/internal/**" + - "dockers/gateway/filter/Dockerfile" + - "versions/GO_VERSION" jobs: build: strategy: max-parallel: 4 runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} steps: - uses: actions/checkout@v3 - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 with: platforms: all - name: Setup Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: "--debug" - name: Cache Docker layers diff --git a/.github/workflows/dockers-gateway-lb-image.yml b/.github/workflows/dockers-gateway-lb-image.yml index 3657fa2703..c91d6f18d6 100644 --- a/.github/workflows/dockers-gateway-lb-image.yml +++ b/.github/workflows/dockers-gateway-lb-image.yml @@ -56,24 +56,43 @@ on: - "pkg/gateway/internal/**" - "dockers/gateway/lb/Dockerfile" - "versions/GO_VERSION" + pull_request_target: + types: [labeled] + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-gateway-lb-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/**/*_mock.go" + - "!internal/db/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/gateway/lb/**" + - "cmd/gateway/lb/**" + - "pkg/gateway/internal/**" + - "dockers/gateway/lb/Dockerfile" + - "versions/GO_VERSION" jobs: build: strategy: max-parallel: 4 runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} steps: - uses: actions/checkout@v3 - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 with: platforms: all - name: Setup Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: "--debug" - name: Login to DockerHub diff --git a/.github/workflows/dockers-helm-operator-image.yml b/.github/workflows/dockers-helm-operator-image.yml index 0ec60b0c7b..827aa86e12 100644 --- a/.github/workflows/dockers-helm-operator-image.yml +++ b/.github/workflows/dockers-helm-operator-image.yml @@ -46,24 +46,38 @@ on: - "charts/vald-helm-operator/values.yaml" - "charts/vald-helm-operator/templates/**" - "versions/OPERATOR_SDK_VERSION" + pull_request_target: + types: [labeled] + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-helm-operator-image.yml" + - "dockers/operator/helm/Dockerfile" + - "charts/vald/Chart.yaml" + - "charts/vald/values.yaml" + - "charts/vald/templates/**" + - "charts/vald-helm-operator/Chart.yaml" + - "charts/vald-helm-operator/values.yaml" + - "charts/vald-helm-operator/templates/**" + - "versions/OPERATOR_SDK_VERSION" jobs: build: strategy: max-parallel: 4 runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} steps: - uses: actions/checkout@v3 - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 with: platforms: all - name: Setup Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: "--debug" - name: Login to DockerHub diff --git a/.github/workflows/dockers-loadtest-image.yml b/.github/workflows/dockers-loadtest-image.yml index 482eb10271..1ffe192d14 100644 --- a/.github/workflows/dockers-loadtest-image.yml +++ b/.github/workflows/dockers-loadtest-image.yml @@ -52,10 +52,27 @@ on: - "cmd/tools/cli/loadtest/**" - "dockers/tools/cli/loadtest/Dockerfile" - "versions/GO_VERSION" + pull_request_target: + types: [labeled] + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-loadtest-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/db/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/tools/cli/loadtest/**" + - "cmd/tools/cli/loadtest/**" + - "dockers/tools/cli/loadtest/Dockerfile" + - "versions/GO_VERSION" jobs: build: runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} strategy: max-parallel: 4 steps: @@ -64,12 +81,12 @@ jobs: run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 with: platforms: all - name: Setup Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: "--debug" - name: Login to DockerHub diff --git a/.github/workflows/dockers-manager-index-image.yml b/.github/workflows/dockers-manager-index-image.yml index bf74ae59a1..b209c72b16 100644 --- a/.github/workflows/dockers-manager-index-image.yml +++ b/.github/workflows/dockers-manager-index-image.yml @@ -52,24 +52,41 @@ on: - "cmd/manager/index/**" - "dockers/manager/index/Dockerfile" - "versions/GO_VERSION" + pull_request_target: + types: [labeled] + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/dockers-manager-index-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/db/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/manager/index/**" + - "cmd/manager/index/**" + - "dockers/manager/index/Dockerfile" + - "versions/GO_VERSION" jobs: build: strategy: max-parallel: 4 runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) }} steps: - uses: actions/checkout@v3 - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 with: platforms: all - name: Setup Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: "--debug" - name: Login to DockerHub