Skip to content

Changed pull request merge condition (#51) #62

Changed pull request merge condition (#51)

Changed pull request merge condition (#51) #62

Workflow file for this run

name: Pipeline
on:
push:
branches:
- main
workflow_dispatch:
inputs:
environment:
description: Environment
type: choice
required: true
options:
- development
- production
version:
description: Image version
type: string
required: true
jobs:
build:
name: Build
uses: ./.github/workflows/build.yml
with:
push: true
secrets: inherit
deploy_to_dev_on_workflow_dispatch:
name: Deploy to dev on manual workflow dispatch
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'development'
uses: ./.github/workflows/deploy.yml
needs:
- build
with:
environment: development
version: ${{ needs.build.outputs.version }}
secrets: inherit
deploy_to_prod_on_workflow_dispatch:
name: Deploy to prod on manual workflow dispatch
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production' && github.event.inputs.branch == 'main'
uses: ./.github/workflows/deploy.yml
needs:
- build
with:
environment: production
version: ${{ needs.build.outputs.version }}
secrets: inherit
deploy_to_dev_on_push_to_main:
name: Deploy to dev on push to main
if: github.event.pull_request.merged == true && github.base_ref == 'refs/heads/main'
uses: ./.github/workflows/deploy.yml
needs:
- build
with:
environment: development
version: ${{ needs.build.outputs.version }}
secrets: inherit
deploy_to_prod_on_push_to_main:
name: Deploy to prod on push to main
if: github.event.pull_request.merged == true && github.base_ref == 'refs/heads/main'
uses: ./.github/workflows/deploy.yml
needs:
- build
- deploy_to_dev_on_push_to_main # wait for the deploy_to_dev job to complete
with:
environment: production
version: ${{ needs.build.outputs.version }}
secrets: inherit