diff --git a/.github/workflows/tyk-dev.yml b/.github/workflows/tyk-dev.yml index ac08d69..bd0100d 100644 --- a/.github/workflows/tyk-dev.yml +++ b/.github/workflows/tyk-dev.yml @@ -13,4 +13,14 @@ jobs: tyk-lint: uses: ./.github/workflows/tyk-lint.yml with: - environment: 'dev' \ No newline at end of file + environment: 'dev' + + # Set up staging APIs and Policies if the Dev assets pass the linter / validation + tyk-set-up-staging: + needs: tyk-lint + uses: ./.github/workflows/tyk-staging.yml + + # Set up prod APIs and Policies if the Dev assets pass the linter / validation + tyk-set-up-prod: + needs: tyk-set-up-staging + uses: ./.github/workflows/tyk-production.yml \ No newline at end of file diff --git a/.github/workflows/tyk-env-promotion.yml b/.github/workflows/tyk-env-promotion.yml index b257efb..7ec48db 100644 --- a/.github/workflows/tyk-env-promotion.yml +++ b/.github/workflows/tyk-env-promotion.yml @@ -9,10 +9,7 @@ on: options: - stg - prod - workflow_call: - inputs: - environment: - type: string + jobs: env-promotion: runs-on: ubuntu-latest diff --git a/.github/workflows/tyk-production.yml b/.github/workflows/tyk-production.yml index 5577fc6..019fd5f 100644 --- a/.github/workflows/tyk-production.yml +++ b/.github/workflows/tyk-production.yml @@ -4,6 +4,7 @@ name: Generate Production Tyk Assets # Perform the env promotion only on push to main branch on: workflow_dispatch: + workflow_call: permissions: contents: write diff --git a/.github/workflows/tyk-staging.yml b/.github/workflows/tyk-staging.yml index c280555..11b8022 100644 --- a/.github/workflows/tyk-staging.yml +++ b/.github/workflows/tyk-staging.yml @@ -5,11 +5,7 @@ name: Generate Staging Tyk Assets # Perform the env promotion only on push to main branch on: workflow_dispatch: - push: - paths: - - 'dev/**' - branches: - - main + workflow_call: jobs: # Set up staging assets @@ -135,7 +131,7 @@ jobs: # done # Run linter and validation workflow - - name: Staging Linter + - name: Run Linter for Staging Environment uses: ./.github/workflows/tyk-lint.yml with: environment: 'stg' @@ -169,10 +165,4 @@ jobs: git config --global user.email "$ORG_EMAIL" git add . git commit -am "CI: Update staging assets" - git push - - # Promote to staging env - tyk-env-promotion: - uses: ./.github/workflows/tyk-env-promotion.yml - with: - environment: 'stg' \ No newline at end of file + git push \ No newline at end of file