diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0ddaf988b..596e7ecf9 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -68,11 +68,21 @@ jobs: - name: Configure AWS Credentials 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-west-2 - name: Upload Artifacts to S3 + shell: bash run: | - s3_path=s3://artifacts.opendistroforelasticsearch.amazon.com/downloads - aws s3 cp ${{ steps.build_zip.outputs.ARTIFACT_PATH }} $s3_path/kibana-plugins/opendistro-security/opendistroSecurityKibana-${{ steps.plugin_version.outputs.plugin_version }}.zip - aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths '/downloads/*' + s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/kibana-plugins/security/" + + # Rename + mv ${{ steps.build_zip.outputs.ARTIFACT_PATH }} opendistroSecurityKibana-${{ steps.plugin_version.outputs.plugin_version }}.zip + zip=`ls opendistroSecurityKibana*.zip` + + # Inject the build number before the suffix + zip_outfile=`basename ${zip%.zip}-build-${GITHUB_RUN_NUMBER}.zip` + + echo "Copying ${zip} to ${s3_prefix}${zip_outfile}" + aws s3 cp --quiet $zip ${s3_prefix}${zip_outfile} +