Skip to content

Commit

Permalink
chore: fix inputs in github workflows (#1719)
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumarrs authored May 20, 2024
1 parent 84e7174 commit 7644c67
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 31 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/deploy-sanity-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@ on:
required: true
SLACK_RELEASE_CHANNEL_ID:
required: true

workflow_dispatch:
inputs:
environment:
type: choice
description: Which environment to deploy the sanity suite
required: true
options:
- production
- staging

permissions:
id-token: write # allows the JWT to be requested from GitHub's OIDC provider
Expand Down Expand Up @@ -152,7 +142,7 @@ jobs:
uses: slackapi/[email protected]
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
PROJECT_NAME: 'Sanity suite - ${{ github.event.inputs.environment }}'
PROJECT_NAME: 'Sanity suite - ${{ inputs.environment }}'
CDN_URL: 'https://cdn.rudderlabs.com/sanity-suite/${{ env.SUITE_CDN_PATH }}/v3/cdn/'
with:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,25 @@ jobs:
env:
HUSKY: 0
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
BUGSNAG_RELEASE_STAGE: ${{ github.event.inputs.bugsnag_release_stage }}
BUGSNAG_RELEASE_STAGE: ${{ inputs.bugsnag_release_stage }}
run: |
npm run setup:ci
- name: Build release artifacts
env:
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
BUGSNAG_RELEASE_STAGE: ${{ github.event.inputs.bugsnag_release_stage }}
BUGSNAG_RELEASE_STAGE: ${{ inputs.bugsnag_release_stage }}
run: |
npm run build:browser
npm run build:browser:modern
- name: Sync Adobe Analytics assets to S3
if: ${{ github.event.inputs.environment }} == 'production'
if: ${{ inputs.environment }} == 'production'
run: |
aws s3 cp assets/integrations/AdobeAnalytics/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/adobe-analytics-js --recursive --cache-control max-age=$${{ env.CACHE_MAX_AGE }}
- name: Create Cloudfront invalidation
if: ${{ github.event.inputs.environment }} == 'production'
if: ${{ inputs.environment }} == 'production'
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/adobe-analytics-js*"
Expand All @@ -111,7 +111,7 @@ jobs:
core_sdk_path_prefix="packages/analytics-js/dist/cdn"
integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
plugins_path_prefix="packages/analytics-js-plugins/dist/cdn"
s3_path_prefix="s3://${{ secrets.AWS_S3_BUCKET_NAME }}/${{ github.event.inputs.s3_dir_path }}"
s3_path_prefix="s3://${{ secrets.AWS_S3_BUCKET_NAME }}/${{ inputs.s3_dir_path }}"
copy_args="--recursive --cache-control max-age=${{ env.CACHE_MAX_AGE }}"
aws s3 cp $core_sdk_path_prefix/legacy/iife/ $s3_path_prefix/legacy/ $copy_args
Expand All @@ -123,10 +123,10 @@ jobs:
- name: Create Cloudfront invalidation
run: |
AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/${{ github.event.inputs.s3_dir_path }}/*"
AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/${{ inputs.s3_dir_path }}/*"
- name: Sync files to S3 versioned directory
if: ${{ github.event.inputs.environment }} == 'production'
if: ${{ inputs.environment }} == 'production'
run: |
core_sdk_path_prefix="packages/analytics-js/dist/cdn"
integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
Expand All @@ -142,13 +142,13 @@ jobs:
aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/ $s3_path_prefix/modern/js-integrations/ $copy_args
- name: Create Cloudfront invalidation
if: ${{ github.event.inputs.environment }} == 'production'
if: ${{ inputs.environment }} == 'production'
run: |
AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/${{ env.CURRENT_VERSION_VALUE }}/*"
# TODO: The '/latest' directory is unused. Might be removed in future.
- name: Sync files to S3 latest
if: ${{ github.event.inputs.environment }} == 'production'
if: ${{ inputs.environment }} == 'production'
run: |
core_sdk_path_prefix="packages/analytics-js/dist/cdn"
integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
Expand All @@ -164,7 +164,7 @@ jobs:
aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/ $s3_path_prefix/modern/js-integrations/ $copy_args
- name: Create Cloudfront invalidation
if: ${{ github.event.inputs.environment }} == 'production'
if: ${{ inputs.environment }} == 'production'
run: |
AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/latest*"
Expand All @@ -173,8 +173,8 @@ jobs:
uses: slackapi/[email protected]
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
PROJECT_NAME: 'JS SDK v3 Browser Package${{ github.event.inputs.action_type }} - ${{ github.event.inputs.environment }}'
CDN_URL: 'https://cdn.rudderlabs.com/${{ github.event.inputs.s3_dir_path }}/modern/rsa.min.js'
PROJECT_NAME: 'JS SDK v3 Browser Package${{ inputs.action_type }} - ${{ inputs.environment }}'
CDN_URL: 'https://cdn.rudderlabs.com/${{ inputs.s3_dir_path }}/modern/rsa.min.js'
with:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:
run: |
core_sdk_path_prefix="packages/analytics-v1.1/dist/cdn"
integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
s3_path_prefix="s3://${{ secrets.AWS_S3_BUCKET_NAME }}/${{ github.event.inputs.s3_dir_path_legacy }}"
s3_path_prefix="s3://${{ secrets.AWS_S3_BUCKET_NAME }}/${{ inputs.s3_dir_path_legacy }}"
copy_args="--recursive --cache-control max-age=${{ env.CACHE_MAX_AGE }}"
aws s3 cp $core_sdk_path_prefix/legacy/ $s3_path_prefix/ $copy_args
Expand All @@ -218,10 +218,10 @@ jobs:
- name: Create Cloudfront invalidation
run: |
AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/${{ github.event.inputs.s3_dir_path_legacy }}*"
AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/${{ inputs.s3_dir_path_legacy }}*"
- name: Sync files to S3 v1.1 versioned directory
if: ${{ github.event.inputs.environment }} == 'production'
if: ${{ inputs.environment }} == 'production'
run: |
core_sdk_path_prefix="packages/analytics-v1.1/dist/cdn"
integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
Expand All @@ -235,12 +235,12 @@ jobs:
aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/ $s3_path_prefix/modern/js-integrations/ $copy_args
- name: Create Cloudfront invalidation
if: ${{ github.event.inputs.environment }} == 'production'
if: ${{ inputs.environment }} == 'production'
run: |
AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/${{ env.CURRENT_VERSION_V1_VALUE }}*"
- name: Sync files to S3 latest (v1.1)
if: ${{ github.event.inputs.environment }} == 'production'
if: ${{ inputs.environment }} == 'production'
run: |
core_sdk_path_prefix="packages/analytics-v1.1/dist/cdn"
integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
Expand All @@ -254,7 +254,7 @@ jobs:
aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/ $s3_path_prefix/modern/js-integrations/ $copy_args
- name: Create Cloudfront invalidation
if: ${{ github.event.inputs.environment }} == 'production'
if: ${{ inputs.environment }} == 'production'
run: |
AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/latest*"
Expand All @@ -263,8 +263,8 @@ jobs:
uses: slackapi/[email protected]
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
PROJECT_NAME: 'JS SDK v1.1 Browser Package${{ github.event.inputs.action_type }} - ${{ github.event.inputs.environment }}'
CDN_URL: 'https://cdn.rudderlabs.com/${{ github.event.inputs.s3_dir_path }}/rudder-analytics.min.js'
PROJECT_NAME: 'JS SDK v1.1 Browser Package${{ inputs.action_type }} - ${{ inputs.environment }}'
CDN_URL: 'https://cdn.rudderlabs.com/${{ inputs.s3_dir_path }}/rudder-analytics.min.js'
with:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
Expand Down

0 comments on commit 7644c67

Please sign in to comment.