diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 7ea71838..64a0edcf 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -3,6 +3,7 @@ on: push: tags: - v* + env: KIBANA_VERSION: 7.10.0 jobs: @@ -13,8 +14,8 @@ jobs: - name: Configure AWS uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }} aws-region: us-east-1 - name: Checkout Kibana @@ -58,8 +59,15 @@ jobs: cd kibana/plugins/anomaly-detection-kibana-plugin yarn build - - name: Upload the artifact + - name: Upload to S3 run: | cd kibana/plugins/anomaly-detection-kibana-plugin - artifact=`ls build/*.zip` - aws s3 cp $artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/kibana-plugins/opendistro-anomaly-detection/ + zip=`ls build/*.zip` + + # Inject the build number before the suffix + zip_outfile=`basename ${zip%.zip}-build-${GITHUB_RUN_NUMBER}.zip` + + s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/kibana-plugins/anomaly-detection/" + + echo "Copying ${zip} to ${s3_prefix}${zip_outfile}" + aws s3 cp --quiet $zip ${s3_prefix}${zip_outfile}