|
| 1 | +name: 📦 Flow Snapshot Docker |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches-ignore: |
| 6 | + - 'main' |
| 7 | + paths-ignore: |
| 8 | + - 'CODEOWNERS' |
| 9 | + - '**.md' |
| 10 | + - '.**' |
| 11 | + workflow_dispatch: |
| 12 | + inputs: |
| 13 | + docker_build_enabled: |
| 14 | + description: 'Enable Docker build' |
| 15 | + required: false |
| 16 | + default: 'true' |
| 17 | + azdo_trigger_enabled: |
| 18 | + description: 'Enable Azure DevOps trigger' |
| 19 | + required: false |
| 20 | + default: 'true' |
| 21 | + argocd_target_branch: |
| 22 | + description: 'argocd target branch name' |
| 23 | + required: false |
| 24 | + default: 'main' |
| 25 | + postman_branch: |
| 26 | + description: postman branch name' |
| 27 | + required: false |
| 28 | + default: 'release-dev' |
| 29 | + |
| 30 | +env: |
| 31 | + # branch choosed by workflow_dispatch or by push event |
| 32 | + CURRENT_BRANCH: ${{ github.event.inputs.branch || github.ref_name }} |
| 33 | + |
| 34 | +jobs: |
| 35 | + checkout: |
| 36 | + name: 🔖 Checkout Repository |
| 37 | + runs-on: ubuntu-22.04 |
| 38 | + steps: |
| 39 | + - name: Checkout code |
| 40 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2 |
| 41 | + with: |
| 42 | + ref: ${{ env.CURRENT_BRANCH }} |
| 43 | + |
| 44 | + docker-build: |
| 45 | + name: 📦 Docker Build and Push |
| 46 | + needs: checkout |
| 47 | + runs-on: ubuntu-22.04 |
| 48 | + if: ${{ github.event_name == 'push' || github.event.inputs.docker_build_enabled == 'true' }} |
| 49 | + steps: |
| 50 | + - name: Checkout code |
| 51 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2 |
| 52 | + with: |
| 53 | + ref: ${{ env.CURRENT_BRANCH }} |
| 54 | + |
| 55 | + - name: Run Snapshot Docker Build/Push |
| 56 | + # https://github.com/pagopa/github-actions-template/releases/tag/v2.0.0 |
| 57 | + uses: pagopa/github-actions-template/payments-flow-docker-snapshot@b825ee193430395706a4a7e580b8435bdded0227 |
| 58 | + with: |
| 59 | + current_branch: ${{ github.ref_name }} |
| 60 | + |
| 61 | + azure-devops-trigger: |
| 62 | + name: 🅰️ Azure DevOps Pipeline Trigger |
| 63 | + needs: docker-build |
| 64 | + runs-on: ubuntu-22.04 |
| 65 | + if: | |
| 66 | + always() && |
| 67 | + needs.docker-build.result != 'failure' && |
| 68 | + github.event.inputs.azdo_trigger_enabled == 'true' |
| 69 | + steps: |
| 70 | + - name: Trigger Azure DevOps Pipeline |
| 71 | + # https://github.com/pagopa/github-actions-template/releases/tag/v2.1.0 |
| 72 | + uses: pagopa/github-actions-template/azure-devops-trigger-pipeline@cad30356d9046af6e7b0cee43db4cf919cc408f9 |
| 73 | + with: |
| 74 | + enable_azure_devops_step: 'true' |
| 75 | + azure_devops_project_url: 'https://dev.azure.com/pagopaspa/idpay-itn-projects' |
| 76 | + azure_devops_pipeline_name: 'idpay-deploy-aks.deploy' |
| 77 | + azure_devops_pat: ${{ secrets.AZURE_DEVOPS_TOKEN }} |
| 78 | + azure_template_parameters: | |
| 79 | + { |
| 80 | + "APPS_TOP": "[idpay-transactions]", |
| 81 | + "APPS_MID": "[]", |
| 82 | + "APPS_EXT": "[]", |
| 83 | + "ARGOCD_TARGET_BRANCH": "${{ github.event.inputs.argocd_target_branch }}", |
| 84 | + "POSTMAN_BRANCH": "${{ github.event.inputs.postman_branch }}", |
| 85 | + "TRIGGER_MESSAGE": "idpay-transactions" |
| 86 | + } |
| 87 | +
|
| 88 | +
|
0 commit comments