Add support for src_query in analytics payload for filtered popular products #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: autosuggest | |
on: | |
# Trigger the workflow on release | |
# push: | |
# branches: | |
# - feature-actions | |
release: | |
types: [published, edited] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.15.1] | |
steps: | |
- name: Checkout Branch | |
id: checkout-branch | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
id: use-node-version | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Infer Environment & Tag Name | |
id: infer_env | |
env: | |
TAG_NAME: ${{ github.event.release.tag_name }} | |
TARGET_COMMITISH: ${{ github.event.release.target_commitish }} | |
run: | | |
deployEnv="staging" | |
if [[ "$TAG_NAME" =~ "rc" ]]; then | |
deployEnv="staging" | |
tag=$TAG_NAME | |
else | |
if [ "$TARGET_COMMITISH" == "master" ]; then | |
deployEnv="production" | |
tag=$TAG_NAME | |
fi | |
fi | |
echo "Deploy Env : $deployEnv" | |
echo "Build tag": "$tag" | |
echo ::set-output name=DEPLOY_ENV::$(echo $deployEnv) | |
echo ::set-output name=BUILD_TAG::$(echo $tag) | |
- name: Configure AWS credentials | |
id: 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-region: us-east-1 | |
- name: Minify autosuggest js | |
id: minify-autosuggest-file | |
run: | | |
npm install uglify-js -g | |
uglifyjs unbxdAutosuggest.js --output unbxdAutosuggest.js | |
- name: Run aws cp command | |
id: aws-upload | |
env: | |
AWS_DISTRIBUTION_ID: ${{ secrets.AWS_DISTRIBUTION_ID }} | |
DEPLOY_ENV: ${{ steps.infer_env.outputs.DEPLOY_ENV }} | |
run: | | |
if [[ $DEPLOY_ENV == "staging" ]]; then | |
aws s3 cp unbxdAutosuggest.js s3://unbxd/unbxdAutosuggest_v1_test.js --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --cache-control max-age=3600 | |
aws cloudfront create-invalidation --distribution-id=$AWS_DISTRIBUTION_ID --paths /unbxdAutosuggest_v1_test.js | |
else | |
aws s3 cp unbxdAutosuggest.js s3://unbxd/unbxdAutosuggest_v1.6.js --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --cache-control max-age=3600 | |
aws cloudfront create-invalidation --distribution-id=$AWS_DISTRIBUTION_ID --paths /unbxdAutosuggest_v1.6.js | |
fi | |
# - name: Slack Notification | |
# uses: rtCamp/action-slack-notify@v2 | |
# if: always() | |
# env: | |
# SLACK_WEBHOOK: ${{ secrets.PLATFORM_SLACK_WEBHOOK_URL }} | |
# SLACK_USERNAME: "AUTOSUGGEST UI Builder" | |
# SLACK_MSG_AUTHOR: ${{ github.actor }} | |
# SLACK_CHANNEL: '#ss-builds' | |
# SLACK_COLOR: ${{ job.status }} | |
# SLACK_ICON: https://github.com/rtCamp.png?size=48 |