From db045180e47de37bf900b31dc0401ce9e1a9a990 Mon Sep 17 00:00:00 2001 From: daknhh Date: Fri, 13 Oct 2023 15:58:00 +0200 Subject: [PATCH] fix --- .github/workflows/test_ipSets.yml | 26 ++++++++++++++--- .../workflows/test_onlymanagedrulegroups.yml | 26 ++++++++++++++--- .github/workflows/test_regexPatternSets.yml | 28 ++++++++++++++++--- 3 files changed, 68 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test_ipSets.yml b/.github/workflows/test_ipSets.yml index 9fb0cb2e..3b65d757 100644 --- a/.github/workflows/test_ipSets.yml +++ b/.github/workflows/test_ipSets.yml @@ -23,17 +23,33 @@ on: jobs: deploy_production_main: - name: Test and deploy Firewalls + name: Test and deploy IpSet Firewall runs-on: ubuntu-latest steps: - name: 📦 Install Taskfile run: | npm install -g @go-task/cli + # Install node.js since we need npm to install cdk + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '18.x' + # Cache node modules for subsequent runs to reduce build times + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-node- + ${{ runner.OS }}- + # Install cdk and typescript globally + - name: Install CDK and typescript globally + run: | + npm i -g aws-cdk typescript ts-node @types/node + npm link typescript - name: 📦 Install Packages run: | - ls - cd .. - ls npm install - name: ⬇️ Checkout uses: actions/checkout@v3 @@ -48,6 +64,8 @@ jobs: mask-aws-account-id: false - name: ✚ Deploy Firewall to AWS run: | + export CDK_DEFAULT_ACCOUNT=${{ env.ACCOUNT_ID }} + export CDK_DEFAULT_REGION=${{ env.AWS_REGION }} task deploy config=ipSetsTests - name: 🗑️ Remove Firewall from AWS run: | diff --git a/.github/workflows/test_onlymanagedrulegroups.yml b/.github/workflows/test_onlymanagedrulegroups.yml index 72bcc23f..541ee8d3 100644 --- a/.github/workflows/test_onlymanagedrulegroups.yml +++ b/.github/workflows/test_onlymanagedrulegroups.yml @@ -23,17 +23,33 @@ on: jobs: deploy_production_main: - name: Test and deploy Firewalls + name: Test and deploy OnlyManagedRuleGroups Firewall runs-on: ubuntu-latest steps: - name: 📦 Install Taskfile run: | npm install -g @go-task/cli + # Install node.js since we need npm to install cdk + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '18.x' + # Cache node modules for subsequent runs to reduce build times + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-node- + ${{ runner.OS }}- + # Install cdk and typescript globally + - name: Install CDK and typescript globally + run: | + npm i -g aws-cdk typescript ts-node @types/node + npm link typescript - name: 📦 Install Packages run: | - ls - cd .. - ls npm install - name: ⬇️ Checkout uses: actions/checkout@v3 @@ -48,6 +64,8 @@ jobs: mask-aws-account-id: false - name: ✚ Deploy Firewall to AWS run: | + export CDK_DEFAULT_ACCOUNT=${{ env.ACCOUNT_ID }} + export CDK_DEFAULT_REGION=${{ env.AWS_REGION }} task deploy config=onlyManagedRuleGroupsTests - name: 🗑️ Remove Firewall from AWS run: | diff --git a/.github/workflows/test_regexPatternSets.yml b/.github/workflows/test_regexPatternSets.yml index 9226fd04..b8978ed7 100644 --- a/.github/workflows/test_regexPatternSets.yml +++ b/.github/workflows/test_regexPatternSets.yml @@ -23,17 +23,33 @@ on: jobs: deploy_production_main: - name: Test and deploy Firewalls + name: Test and deploy RegexPatternSets Firewall runs-on: ubuntu-latest steps: - name: 📦 Install Taskfile run: | npm install -g @go-task/cli + # Install node.js since we need npm to install cdk + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '18.x' + # Cache node modules for subsequent runs to reduce build times + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-node- + ${{ runner.OS }}- + # Install cdk and typescript globally + - name: Install CDK and typescript globally + run: | + npm i -g aws-cdk typescript ts-node @types/node + npm link typescript - name: 📦 Install Packages run: | - ls - cd .. - ls npm install - name: ⬇️ Checkout uses: actions/checkout@v3 @@ -48,7 +64,11 @@ jobs: mask-aws-account-id: false - name: ✚ Deploy Firewall to AWS run: | + export CDK_DEFAULT_ACCOUNT=${{ env.ACCOUNT_ID }} + export CDK_DEFAULT_REGION=${{ env.AWS_REGION }} task deploy config=regexPatternSetsTests - name: 🗑️ Remove Firewall from AWS run: | + export CDK_DEFAULT_ACCOUNT=${{ env.ACCOUNT_ID }} + export CDK_DEFAULT_REGION=${{ env.AWS_REGION }} task destroy config=regexPatternSetsTests \ No newline at end of file