From b2f47a5e10f4b0d51d720e802098b69e4711017a Mon Sep 17 00:00:00 2001 From: afdesk Date: Tue, 24 Sep 2024 20:37:06 +0600 Subject: [PATCH 1/2] ci: add publishing into Public ECR --- .github/workflows/cron.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index e84eac2b..7b1ff83f 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -74,3 +74,20 @@ jobs: ghcr.io/${{ github.repository }}:${tag} \ db.tar.gz:application/vnd.aquasec.trivy.db.layer.v1.tar+gzip done + + - name: Login to ECR + uses: docker/login-action@v3 + with: + registry: public.ecr.aws + username: ${{ secrets.ECR_ACCESS_KEY_ID }} + password: ${{ secrets.ECR_SECRET_ACCESS_KEY }} + + - name: Upload assets to ECR + run: | + ./oras version + tags=(latest ${{ env.VERSION }}) + for tag in ${tags[@]}; do + ./oras push --artifact-type application/vnd.aquasec.trivy.config.v1+json \ + public.ecr.aws/aquasecurity/trivy:${tag} \ + db.tar.gz:application/vnd.aquasec.trivy.db.layer.v1.tar+gzip + done \ No newline at end of file From 490f215550f624f05c8bd6ac2e77aa3ee483d15e Mon Sep 17 00:00:00 2001 From: afdesk Date: Tue, 24 Sep 2024 21:01:33 +0600 Subject: [PATCH 2/2] update repo name --- .github/workflows/cron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 7b1ff83f..2648bb55 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -88,6 +88,6 @@ jobs: tags=(latest ${{ env.VERSION }}) for tag in ${tags[@]}; do ./oras push --artifact-type application/vnd.aquasec.trivy.config.v1+json \ - public.ecr.aws/aquasecurity/trivy:${tag} \ + public.ecr.aws/aquasecurity/trivy-db:${tag} \ db.tar.gz:application/vnd.aquasec.trivy.db.layer.v1.tar+gzip done \ No newline at end of file