Merge pull request #2043 from LerianStudio/feature/MDZ-2023 #858
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Build" | |
| on: | |
| push: | |
| tags: | |
| - '**' | |
| permissions: | |
| id-token: write | |
| contents: read | |
| pull-requests: write | |
| packages: write | |
| jobs: | |
| build: | |
| uses: LerianStudio/github-actions-shared-workflows/.github/workflows/build.yml@v1.23.1 | |
| with: | |
| runner_type: "blacksmith-4vcpu-ubuntu-2404" | |
| filter_paths: |- | |
| components/crm | |
| components/ledger | |
| shared_paths: | | |
| go.mod | |
| go.sum | |
| pkg/ | |
| Makefile | |
| path_level: '2' | |
| app_name_prefix: "midaz" | |
| enable_dockerhub: true | |
| enable_ghcr: true | |
| dockerhub_org: lerianstudio | |
| enable_gitops_artifacts: true | |
| # helm dispatch configuration | |
| enable_helm_dispatch: true | |
| helm_chart: "midaz" | |
| helm_detect_env_changes: true | |
| helm_values_key_mappings: '{"midaz-crm": "crm", "midaz-ledger": "ledger"}' | |
| secrets: inherit | |
| # ========================= | |
| # GITOPS UPDATE | |
| # ========================= | |
| update_gitops: | |
| needs: [build] | |
| if: >- | |
| !cancelled() && | |
| needs.build.result == 'success' && | |
| (contains(github.ref, '-beta') || contains(github.ref, '-rc')) && | |
| needs.build.outputs.has_builds == 'true' | |
| uses: LerianStudio/github-actions-shared-workflows/.github/workflows/gitops-update.yml@v1.23.1 | |
| with: | |
| runner_type: "firmino-lxc-runners" | |
| gitops_repository: "LerianStudio/midaz-firmino-gitops" | |
| app_name: "midaz" | |
| deploy_in_firmino: true | |
| deploy_in_clotilde: true | |
| artifact_pattern: "gitops-tags-midaz-*" | |
| yaml_key_mappings: '{"midaz-crm.tag": ".crm.image.tag", "midaz-ledger.tag": ".ledger.image.tag"}' | |
| commit_message_prefix: "midaz" | |
| enable_argocd_sync: true | |
| enable_docker_login: false | |
| secrets: inherit | |
| # ========================= | |
| # UPLOAD MIGRATIONS TO S3 | |
| # ========================= | |
| upload-onboarding-migrations: | |
| needs: [build] | |
| if: needs.build.result == 'success' | |
| uses: LerianStudio/github-actions-shared-workflows/.github/workflows/s3-upload.yml@v1.23.1 | |
| with: | |
| s3_bucket: "lerian-migration-files" | |
| file_pattern: "components/ledger/migrations/onboarding/*.sql" | |
| s3_prefix: "ledger/onboarding/postgresql" | |
| strip_prefix: "components/ledger/migrations/onboarding" | |
| flatten: false | |
| secrets: | |
| AWS_ROLE_ARN: ${{ secrets.AWS_MIGRATIONS_ROLE_ARN }} | |
| upload-transaction-migrations: | |
| needs: [build] | |
| if: needs.build.result == 'success' | |
| uses: LerianStudio/github-actions-shared-workflows/.github/workflows/s3-upload.yml@v1.23.1 | |
| with: | |
| s3_bucket: "lerian-migration-files" | |
| file_pattern: "components/ledger/migrations/transaction/*.sql" | |
| s3_prefix: "ledger/transaction/postgresql" | |
| strip_prefix: "components/ledger/migrations/transaction" | |
| flatten: false | |
| secrets: | |
| AWS_ROLE_ARN: ${{ secrets.AWS_MIGRATIONS_ROLE_ARN }} | |
| # ========================= | |
| # E2E TESTS | |
| # ========================= | |
| api_dog_e2e_tests: | |
| needs: [update_gitops] | |
| if: needs.update_gitops.result == 'success' | |
| uses: LerianStudio/github-actions-shared-workflows/.github/workflows/api-dog-e2e-tests.yml@v1.23.1 | |
| with: | |
| runner_type: "firmino-lxc-runners" | |
| auto_detect_environment: true | |
| secrets: | |
| test_scenario_id: ${{ secrets.MIDAZ_APIDOG_TEST_SCENARIO_ID }} | |
| apidog_access_token: ${{ secrets.APIDOG_ACCESS_TOKEN }} | |
| dev_environment_id: ${{ secrets.MIDAZ_APIDOG_DEV_ENVIRONMENT_ID }} | |
| stg_environment_id: ${{ secrets.MIDAZ_APIDOG_STG_ENVIRONMENT_ID }} |