Skip to content

Commit

Permalink
update the workflow logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Long Le authored and Long Le committed Sep 16, 2024
1 parent 4893659 commit 0cfe0dc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/tyk-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@ jobs:
tyk-lint:
uses: ./.github/workflows/tyk-lint.yml
with:
environment: 'dev'
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
5 changes: 1 addition & 4 deletions .github/workflows/tyk-env-promotion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ on:
options:
- stg
- prod
workflow_call:
inputs:
environment:
type: string

jobs:
env-promotion:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tyk-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/tyk-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
git push

0 comments on commit 0cfe0dc

Please sign in to comment.