Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pie-monorepo): DSW-000 fix cdn upload #2263

Merged
merged 3 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/stupid-bottles-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"pie-monorepo": patch
---

[Fixed] - CDN publish logic v2
38 changes: 29 additions & 9 deletions .github/workflows/changeset-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,35 @@ jobs:
runs-on: ${{ inputs.os }}
if: needs.changesets.outputs.published == 'true' && contains(fromJson(needs.changesets.outputs.publishedPackages).*.name, '@justeattakeaway/pie-cookie-banner')
steps:
# Checkout the Repo
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Setup Repo
- name: Setup Repo
uses: ./.github/actions/setup-repo
with:
node-version: ${{ inputs.node-version }}
os: ${{ inputs.os }}

# Build
- name: Build Cookie Banner
uses: ./.github/actions/run-script
with:
script-name: "build --filter=pie-cookie-banner"

- name: Extract cookie banner version
id: extract-version
run: |
PACKAGES='${{ needs.changesets.outputs.publishedPackages}}'
COOKIE_BANNER_VERSION=$(echo $PACKAGES | jq -r '.[] | select(.name == "@justeattakeaway/pie-cookie-banner") | .version')
echo "cookie_banner_version=$COOKIE_BANNER_VERSION" >> $GITHUB_OUTPUT
- name: Publish Cookie Banner CDN
uses: ./.github/workflows/pie-cookie-banner-cdn-publish.yml
with:
os: ${{ inputs.os }}
node-version: ${{ inputs.node-version }}
package-version: v${{ steps.extract-version.outputs.cookie_banner_version }}
PACKAGES='${{ needs.changesets.outputs.publishedPackages }}'
cookie_banner_version=$(echo $PACKAGES | jq -r '.[] | select(.name == "@justeattakeaway/pie-cookie-banner") | .version')
echo "COOKIE_BANNER_VERSION=$cookie_banner_version" >> $GITHUB_ENV

- name: Upload to S3
run: |
aws s3 sync $GITHUB_WORKSPACE/packages/components/pie-cookie-banner/cdn_dist/ s3://$PIE_CDN_BUCKET_NAME/pie-cookie-banner/$COOKIE_BANNER_VERSION/ --region $AWS_REGION --content-type "text/javascript"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: eu-west-1
PIE_CDN_BUCKET_NAME: ${{ vars.PIE_CDN_BUCKET_NAME }}
44 changes: 0 additions & 44 deletions .github/workflows/pie-cookie-banner-cdn-publish.yml

This file was deleted.

Loading