|
| 1 | +name: 'Auto Deploy Main' |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: |
| 6 | + - closed |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + versioning: |
| 11 | + uses: ./.github/workflows/reusable__generate-version.yml |
| 12 | + permissions: |
| 13 | + packages: write |
| 14 | + id-token: write |
| 15 | + contents: write |
| 16 | + attestations: write |
| 17 | + with: |
| 18 | + RELEASE_TYPE: Patch |
| 19 | + secrets: |
| 20 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 21 | + |
| 22 | + |
| 23 | + build-docker-image: |
| 24 | + needs: [versioning] |
| 25 | + uses: ./.github/workflows/reusable__build.yml |
| 26 | + with: |
| 27 | + COMMIT_HASH: ${{ github.head_ref || github.ref_name }} |
| 28 | + FULL_IMAGE_TAG: ${{needs.versioning.outputs.IMAGE_TAG}} # Use the output from the versioning job. |
| 29 | + |
| 30 | + e2e: |
| 31 | + needs: [build-docker-image, versioning] |
| 32 | + uses: ./.github/workflows/reusable__e2e-testing.yml |
| 33 | + with: |
| 34 | + DOCKER_IMAGE_TAG: ${{ needs.versioning.outputs.IMAGE_TAG }} |
| 35 | + |
| 36 | + deploy-release: |
| 37 | + needs: |
| 38 | + - e2e |
| 39 | + - versioning |
| 40 | + uses: ./.github/workflows/reusable__deploy-release.yml |
| 41 | + with: |
| 42 | + COMMIT_HASH: ${{needs.versioning.outputs.SHORT_COMMIT_HASH }} |
| 43 | + FULL_IMAGE_TAG: ${{ needs.versioning.outputs.IMAGE_TAG }} |
| 44 | + INFRA_OVERLAY_FOLDER: deployments/overlays |
| 45 | + OKR_INFRA_REPOSITORY_PATH: ${{ vars.OKR_INFRA_REPOSITORY_PATH }} |
| 46 | + PUZZLE_GITLAB_FQDN: ${{vars.PUZZLE_GITLAB_FQDN}} |
| 47 | + deployment_environment: "STAGING" |
| 48 | + SEMVER_VERSION: ${{ needs.versioning.outputs.SEMVER_VERSION }} |
| 49 | + create_release: false |
| 50 | + DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }} |
| 51 | + DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }} |
| 52 | + secrets: |
| 53 | + GITLAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }} |
| 54 | + DOCKER_REGISTRY_TOKEN: ${{ secrets.DOCKER_REGISTRY_TOKEN }} |
| 55 | + |
| 56 | + |
| 57 | + generate-and-push-sbom: |
| 58 | + needs: |
| 59 | + - deploy-release |
| 60 | + uses: ./.github/workflows/reusable__deptrack-push-action.yml |
| 61 | + secrets: inherit |
| 62 | + with: |
| 63 | + ENVIRONMENT_NAME: STAGING |
| 64 | + |
| 65 | + update-sonarqube: |
| 66 | + needs: |
| 67 | + - deploy-release |
| 68 | + uses: './.github/workflows/reusable__sonarqube.yml' |
| 69 | + secrets: inherit |
| 70 | + with: |
| 71 | + SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} |
| 72 | + |
0 commit comments