Skip to content

πŸ“¦ Flow Snapshot Docker #61

πŸ“¦ Flow Snapshot Docker

πŸ“¦ Flow Snapshot Docker #61

name: πŸ“¦ Flow Snapshot Docker
on:
push:
branches-ignore:
- 'develop'
- 'uat'
- 'main'
paths-ignore:
- 'CODEOWNERS'
- '**.md'
- '.**'
workflow_dispatch:
inputs:
docker_build_enabled:
description: 'Enable Docker build'
required: false
default: 'true'
azdo_trigger_enabled:
description: 'Enable Azure DevOps trigger'
required: false
default: 'true'
argocd_target_branch:
description: 'argocd target branch name'
required: false
default: 'main'
postman_branch:
description: postman branch name'
required: false
default: 'develop'
env:
# branch choosed by workflow_dispatch or by push event
CURRENT_BRANCH: ${{ github.event.inputs.branch || github.ref_name }}
jobs:
checkout:
name: πŸ”– Checkout Repository
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
with:
ref: ${{ env.CURRENT_BRANCH }}
docker-build:
name: πŸ“¦ Docker Build and Push
needs: checkout
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'push' || github.event.inputs.docker_build_enabled == 'true' }}
steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
with:
ref: ${{ env.CURRENT_BRANCH }}
- name: Run Snapshot Docker Build/Push
# https://github.com/pagopa/github-actions-template/releases/tag/v2.0.0
uses: pagopa/github-actions-template/payments-flow-docker-snapshot@b825ee193430395706a4a7e580b8435bdded0227
with:
current_branch: ${{ github.ref_name }}
azure-devops-trigger:
name: πŸ…°οΈ Azure DevOps Pipeline Trigger
needs: docker-build
runs-on: ubuntu-22.04
if: |
always() &&
needs.docker-build.result != 'failure' &&
github.event.inputs.azdo_trigger_enabled == 'true'
steps:
- name: Trigger Azure DevOps Pipeline
# https://github.com/pagopa/github-actions-template/releases/tag/v2.0.0
uses: pagopa/github-actions-template/azure-devops-trigger-pipeline@b825ee193430395706a4a7e580b8435bdded0227
with:
enable_azure_devops_step: 'true'
azure_devops_project_url: 'https://dev.azure.com/pagopaspa/p4pa-projects'
azure_devops_pipeline_name: 'p4pa-payhub-deploy-aks.deploy'
azure_devops_pat: ${{ secrets.AZURE_DEVOPS_TOKEN }}
azure_template_parameters: |
{
"APPS_TOP": "[p4pa-auth]",
"ARGOCD_TARGET_BRANCH": "${{ github.event.inputs.argocd_target_branch }}",
"POSTMAN_BRANCH": "${{ github.event.inputs.postman_branch }}"
"TRIGGER_MESSAGE": "p4pa-auth"
}