diff --git a/.github/workflows/upload-legacy-ami.yml b/.github/workflows/upload-legacy-ami.yml index 43e30f4..25b5873 100644 --- a/.github/workflows/upload-legacy-ami.yml +++ b/.github/workflows/upload-legacy-ami.yml @@ -86,6 +86,20 @@ jobs: --copy-to-regions \ --public + delete-deprecated-images: + name: Deploy images page + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + needs: upload-ami + environment: images + steps: + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: DeterminateSystems/nix-installer-action@7993355175c2765e5733dae74f3e0786fe0e5c4f # v12 + - uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8 + - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.1 + with: + role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/github-pages + aws-region: ${{ vars.AWS_REGION }} - name: Delete deprecated AMIs if: github.ref == 'refs/heads/main' run: | @@ -95,7 +109,7 @@ jobs: name: Deploy images page if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest - needs: upload-ami + needs: [ upload-ami, delete-deprecated-images ] permissions: contents: read id-token: write