building image actions is triggered only if a pull request has been merged into main
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
name: Build and Push Docker Image
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
pull_request:
|
||||||
branches: [ "ci-cd" ]
|
types: [closed]
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: git.vmn.su
|
REGISTRY: git.vmn.su
|
||||||
@@ -11,6 +12,7 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-backend:
|
build-and-push-backend:
|
||||||
|
if: github.event.pull_request.merged == true
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -32,6 +34,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
build-and-push-frontend:
|
build-and-push-frontend:
|
||||||
|
if: github.event.pull_request.merged == true
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -53,6 +56,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
notify-deployment-server:
|
notify-deployment-server:
|
||||||
|
if: github.event.pull_request.merged == true
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger the webhook on the deployment server to start pulling the images
|
- name: Trigger the webhook on the deployment server to start pulling the images
|
||||||
|
|||||||
Reference in New Issue
Block a user