From 719059f86bfd38c4daabc4b52c877b0519b86a28 Mon Sep 17 00:00:00 2001 From: Avinash-Sanpala Date: Tue, 28 May 2024 10:32:26 +0530 Subject: [PATCH] feat: Publish CLI Docker image during release instead of during PR merge to main --- .github/workflows/release.yml | 11 +++++++++++ .github/workflows/snapshot.yml | 16 ++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc57f77a0..1db13cda3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -195,3 +195,14 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }} AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + + snapshot: + if: github.ref == 'refs/heads/main' + needs: snapshot + uses: newrelic/newrelic-cli/.github/workflows/snapshot.yml@main + secrets: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + SPLIT_PROD_KEY: ${{ secrets.SPLIT_PROD_KEY }} + SPLIT_STAGING_KEY: ${{ secrets.SPLIT_STAGING_KEY }} + SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }} diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 3dd53b1c8..9a73c4b4c 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -1,8 +1,20 @@ name: Snapshot +permissions: write-all + on: - push: - branches: [main] + workflow_call: + secrets: + DOCKER_USERNAME: + required: true + DOCKER_PASSWORD: + required: true + SPLIT_PROD_KEY: + required: true + SPLIT_STAGING_KEY: + required: true + SEGMENT_WRITE_KEY: + required: true jobs: snapshot: