Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: DSW-2146 Updated closed prs yml to support Nuxt app #168

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/handle-closed-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
outputs:
hasNextJs13Env: ${{ steps.list-environments.outputs.hasNextJs13Env }}
hasNextJs14Env: ${{ steps.list-environments.outputs.hasNextJs14Env }}
hasNuxtEnv: ${{ steps.list-environments.outputs.hasNuxtEnv }}
hasVanillaJsEnv: ${{ steps.list-environments.outputs.hasVanillaJsEnv }}
steps:
- name: Checkout
Expand Down Expand Up @@ -43,14 +44,17 @@ jobs:
// Check for existence of specific environments
const hasNextJs13Env = envList.includes(`nextjs-app-v13-pr-${pullRequestNumber}`);
const hasNextJs14Env = envList.includes(`nextjs-app-v14-pr-${pullRequestNumber}`);
const hasNuxtEnv = envList.includes(`nuxt-app-pr-${pullRequestNumber}`);
const hasVanillaJsEnv = envList.includes(`vanilla-app-pr-${pullRequestNumber}`);

console.log('Has NextJS 13 Env:', hasNextJs13Env);
console.log('Has NextJS 14 Env:', hasNextJs14Env);
console.log('Has Nuxt Env:', hasNuxtEnv);
console.log('Has VanillaJS Env:', hasVanillaJsEnv);

core.setOutput('hasNextJs13Env', hasNextJs13Env ? 'true' : 'false');
core.setOutput('hasNextJs14Env', hasNextJs14Env ? 'true' : 'false');
core.setOutput('hasNuxtEnv', hasNuxtEnv ? 'true' : 'false');
core.setOutput('hasVanillaJsEnv', hasVanillaJsEnv ? 'true' : 'false');

- name: Delete associated NextJS 13 app environment
Expand All @@ -77,6 +81,18 @@ jobs:
environment-name: nextjs-app-v14-pr-${{ github.event.pull_request.number }}
branch-name: 'pr${{ github.event.pull_request.number }}'

- name: Delete associated Nuxt app environment
if: ${{ steps.list-environments.outputs.hasNuxtEnv == 'true' }}
uses: ./.github/actions/amplify-teardown
with:
github-token: ${{ secrets.PIE_BOT_TOKEN }}
amplify-app-id: d36dan3bxjue8c
aws-region: 'eu-west-1'
aws-access-key-id: ${{ secrets.AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
environment-name: nuxt-app-pr-${{ github.event.pull_request.number }}
branch-name: 'pr${{ github.event.pull_request.number }}'

- name: Delete associated Vanilla app environment
if: ${{ steps.list-environments.outputs.hasVanillaJsEnv == 'true' }}
uses: ./.github/actions/amplify-teardown
Expand Down
Loading