Skip to content

Commit

Permalink
feat: P4ADEV-1886-migrate-to-argoCD (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoGiuliani authored Feb 7, 2025
1 parent 5917999 commit cd686b9
Show file tree
Hide file tree
Showing 11 changed files with 150 additions and 442 deletions.
182 changes: 0 additions & 182 deletions .devops/deploy-pipelines.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/flow-docker-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
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 }}

permissions:
packages: write
contents: read

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.1.1
uses: pagopa/github-actions-template/payments-flow-docker-snapshot@e67e0ec4bb01d6cb5065e311ba0e1c92c49966a7
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.1.0
uses: pagopa/github-actions-template/azure-devops-trigger-pipeline@cad30356d9046af6e7b0cee43db4cf919cc408f9
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-pu-sil]",
"ARGOCD_TARGET_BRANCH": "${{ github.event.inputs.argocd_target_branch }}",
"POSTMAN_BRANCH": "${{ github.event.inputs.postman_branch }}",
"TRIGGER_MESSAGE": "p4pa-pu-sil"
}
58 changes: 58 additions & 0 deletions .github/workflows/flow-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: 🚀 Flow Release

on:
push:
branches:
- develop
- uat
- main
paths-ignore:
- 'CODEOWNERS'
- '**.md'
- '.**'
workflow_dispatch:

permissions:
packages: write
contents: write

jobs:
checkout:
name: 🔖 Checkout Repository
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
with:
ref: ${{ github.ref_name }}

payments-flow-release:
name: 🚀 Release
runs-on: ubuntu-22.04
needs: checkout
steps:
- name: 🚀 release + docker
# https://github.com/pagopa/github-actions-template/releases/tag/v2.1.1
uses: pagopa/github-actions-template/payments-flow-release@e67e0ec4bb01d6cb5065e311ba0e1c92c49966a7
with:
current_branch: ${{ github.ref_name }}

azure-devops-trigger:
name: 🅰️ Azure DevOps Pipeline Trigger
needs: payments-flow-release
runs-on: ubuntu-22.04
steps:
- name: Trigger Azure DevOps Pipeline
# https://github.com/pagopa/github-actions-template/releases/tag/v2.1.0
uses: pagopa/github-actions-template/azure-devops-trigger-pipeline@cad30356d9046af6e7b0cee43db4cf919cc408f9
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-pu-sil]",
"POSTMAN_BRANCH": "${{ github.ref_name }}",
"TRIGGER_MESSAGE": "p4pa-pu-sil"
}
24 changes: 0 additions & 24 deletions .github/workflows/release.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/snapshot-docker.yml

This file was deleted.

Loading

0 comments on commit cd686b9

Please sign in to comment.