From 2ee5b212eb39837dee0160903b31ee4134e6da64 Mon Sep 17 00:00:00 2001 From: Artur Reznikov Date: Thu, 20 Jun 2024 13:35:41 -0700 Subject: [PATCH 1/2] mv cleaner before packer --- .github/workflows/release-public-ami.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/release-public-ami.yml b/.github/workflows/release-public-ami.yml index 208404bdd..69b2ff914 100644 --- a/.github/workflows/release-public-ami.yml +++ b/.github/workflows/release-public-ami.yml @@ -24,6 +24,21 @@ jobs: check-latest: true - run: go version + - name: install nodejs + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: install npx aws-amicleaner + run: npm install -g aws-amicleaner + + - name: clean up old AMIs + run: npx aws-amicleaner --include-name 'public-avalanchecli-ubuntu-*' --exclude-newest 1 --exclude-days 2 --region="*" --force + env: + AWS_ACCESS_KEY_ID: ${{ secrets.EXPERIMENTAL_AWS_ACCESS_KEY_PACKER }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.EXPERIMENTAL_AWS_SECRET_KEY_PACKER }} + AWS_REGION: us-east-1 + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: From 849c88f7f7eb95b437785b7a7a2dc495ab2beb88 Mon Sep 17 00:00:00 2001 From: Artur Reznikov Date: Thu, 20 Jun 2024 15:07:56 -0700 Subject: [PATCH 2/2] remove cleanup after packer --- .github/workflows/release-public-ami.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/release-public-ami.yml b/.github/workflows/release-public-ami.yml index 69b2ff914..ae6c8eabc 100644 --- a/.github/workflows/release-public-ami.yml +++ b/.github/workflows/release-public-ami.yml @@ -70,18 +70,3 @@ jobs: id: build run: "packer build -color=false -force ./.github/packer/aws-ubuntu-docker.pkr.hcl" - - name: install nodejs - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: install npx aws-amicleaner - run: npm install -g aws-amicleaner - - - name: clean up old AMIs - run: npx aws-amicleaner --include-name 'public-avalanchecli-ubuntu-*' --exclude-newest 2 --exclude-days 14 --region="*" --force - env: - AWS_ACCESS_KEY_ID: ${{ secrets.EXPERIMENTAL_AWS_ACCESS_KEY_PACKER }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.EXPERIMENTAL_AWS_SECRET_KEY_PACKER }} - AWS_REGION: us-east-1 -