Merge pull request #940 from thecodingmachine/restrictCD

FIX: the deploy action now only start when the label 'deploy' is applied to the PR
This commit is contained in:
Kharhamel 2021-04-27 15:49:15 +02:00 committed by GitHub
commit 998e051a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 9 deletions

View File

@ -1,7 +1,9 @@
name: Build, push and deploy Docker image name: Build, push and deploy Docker image
on: on:
- push pull_request:
types: [ labeled, synchronize ]
# Enables BuildKit # Enables BuildKit
env: env:
@ -10,7 +12,7 @@ env:
jobs: jobs:
build-front: build-front:
if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -34,7 +36,7 @@ jobs:
add_git_labels: true add_git_labels: true
build-back: build-back:
if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -57,7 +59,7 @@ jobs:
add_git_labels: true add_git_labels: true
build-pusher: build-pusher:
if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -80,7 +82,7 @@ jobs:
add_git_labels: true add_git_labels: true
build-uploader: build-uploader:
if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -103,7 +105,7 @@ jobs:
add_git_labels: true add_git_labels: true
build-maps: build-maps:
if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -1,7 +1,8 @@
name: Cleanup images and environments name: Cleanup images and environments
on: on:
- delete pull_request:
types: [ closed ]
# Enables BuildKit # Enables BuildKit
env: env:

View File

@ -3,8 +3,11 @@
name: "Continuous Integration" name: "Continuous Integration"
on: on:
- "pull_request" push:
- "push" branches:
- master
- develop
pull_request:
jobs: jobs: