-
Notifications
You must be signed in to change notification settings - Fork 235
chore: publish 2nd generation preview docs in PR #5875
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c90cc62
chore: publish 2nd generation preview docs in PR
caseyisonit 40b82bf
chore: typo
caseyisonit 4ef14e0
chore: attempting to fix azure
caseyisonit f9565b1
chore: attempting to fix azure
caseyisonit 3c84cf4
chore: github doesnt like numbers i guess
caseyisonit d53f318
chore: too fast too furious
caseyisonit c12b099
chore: fix docs path resolving
caseyisonit b825090
chore: try again
caseyisonit 4f47e5c
chore: try again
caseyisonit cbc48a5
chore: damn hyphens
caseyisonit c5bcc46
chore: corrected commentorupdate
caseyisonit 252c1ff
chore: fix smoke test
caseyisonit fbe6b78
chore: smoke test fix
caseyisonit 6c0c5b7
chore: smoke test fix
caseyisonit 4aff75d
chore: yaml linting
caseyisonit ff53aab
chore: correct yml linting, move smoke tests to preview docs
caseyisonit e5b01a1
chore: borked actions
caseyisonit 4dd1cec
chore: borked actions
caseyisonit ab65283
chore: side nav search url fix
caseyisonit e986783
chore: fix e2e tests attempt
caseyisonit 1273afa
Merge branch 'main' into caseyisonit/github-preview-links
caseyisonit 488f1b9
chore: missing slashes
caseyisonit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,146 +1,160 @@ | ||
| name: Preview Documentation (Azure Blob Storage) | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, closed] | ||
| branches: | ||
| - "**" | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, closed] | ||
| branches: | ||
| - '**' | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| env: | ||
| AZCOPY_AUTO_LOGIN_TYPE: SPN | ||
| AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZURE_CLIENT_ID }} | ||
| AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
| AZCOPY_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | ||
| AZCOPY_AUTO_LOGIN_TYPE: SPN | ||
| AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZURE_CLIENT_ID }} | ||
| AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
| AZCOPY_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | ||
|
|
||
| jobs: | ||
| build_and_deploy_job: | ||
| if: github.event_name == 'pull_request' && github.event.action != 'closed' | ||
| runs-on: ubuntu-latest | ||
| name: Build and Deploy Job | ||
| outputs: | ||
| doc_url: ${{ steps.deploy.outputs.docs_url }} | ||
| steps: | ||
| ## --- SETUP --- ## | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Use Node LTS version | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: yarn | ||
|
|
||
| - name: Enable Corepack | ||
| run: corepack enable | ||
|
|
||
| - name: Generate PR hash | ||
| id: pr_hash | ||
| run: | | ||
| # Use just PR number so each commit overwrites the previous deployment | ||
| pr_hash="pr-${{ github.event.pull_request.number }}" | ||
| echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" | ||
| echo "Generated PR hash: ${pr_hash}" | ||
| ## --- YARN CACHE --- ## | ||
| - name: Check for cached dependencies | ||
| continue-on-error: true | ||
| id: cache-dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| .cache/yarn | ||
| node_modules | ||
| key: ubuntu-latest-node20-${{ hashFiles('yarn.lock', 'package.json') }} | ||
|
|
||
| ## --- INSTALL & BUILD --- ## | ||
| - name: Install dependencies | ||
| shell: bash | ||
| run: yarn install --immutable | ||
|
|
||
| - name: Build 1st-gen | ||
| run: yarn workspace @spectrum-web-components/1st-gen build | ||
|
|
||
| - name: Build 2nd-gen core | ||
| run: yarn workspace @spectrum-web-components/core build | ||
|
|
||
| - name: Build 2nd-gen swc | ||
| run: yarn workspace @adobe/swc build | ||
|
|
||
| - name: Generate Custom Elements Manifest | ||
| run: yarn workspace @spectrum-web-components/1st-gen docs:analyze | ||
|
|
||
| - name: Move CEM to Storybook directory | ||
| run: cp 1st-gen/projects/documentation/custom-elements.json 1st-gen/storybook/ | ||
|
|
||
| - name: Build documentation with path prefix | ||
| env: | ||
| SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs | ||
| run: | | ||
| yarn workspace @spectrum-web-components/1st-gen docs:build | ||
| - name: Build Storybook | ||
| run: yarn workspace @spectrum-web-components/1st-gen storybook:build | ||
|
|
||
| ## --- DEPLOY TO AZURE BLOB STORAGE --- ## | ||
| - name: Setup AzCopy | ||
| uses: ./.github/actions/setup-azcopy | ||
|
|
||
| - name: Deploy to Azure Blob Storage | ||
| id: deploy | ||
| env: | ||
| PR_HASH: ${{ steps.pr_hash.outputs.hash }} | ||
| run: | | ||
| # Upload documentation | ||
| echo "Uploading documentation to ${PR_HASH}/docs/" | ||
| azcopy copy "1st-gen/projects/documentation/dist/*" \ | ||
| "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/" \ | ||
| --recursive \ | ||
| --from-to LocalBlob | ||
| # Upload Storybook | ||
| echo "Uploading Storybook to ${PR_HASH}/docs/storybook/" | ||
| azcopy copy "1st-gen/storybook-static/*" \ | ||
| "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/storybook/" \ | ||
| --recursive \ | ||
| --from-to LocalBlob | ||
| # Set output URLs | ||
| docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/" | ||
| storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/storybook/" | ||
| echo "docs_url=${docs_url}" >> "$GITHUB_OUTPUT" | ||
| echo "storybook_url=${storybook_url}" >> "$GITHUB_OUTPUT" | ||
| echo "Deployed to: ${docs_url}" | ||
| close_pull_request_job: | ||
| if: github.event_name == 'pull_request' && github.event.action == 'closed' | ||
| runs-on: ubuntu-latest | ||
| name: Clean up PR deployment | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Generate PR hash | ||
| id: pr_hash | ||
| run: | | ||
| # Create the same hash as in the deploy job | ||
| pr_hash="pr-${{ github.event.pull_request.number }}" | ||
| echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" | ||
| - name: Setup AzCopy | ||
| uses: ./.github/actions/setup-azcopy | ||
|
|
||
| - name: Clean up PR deployment | ||
| env: | ||
| PR_HASH: ${{ steps.pr_hash.outputs.hash }} | ||
| run: | | ||
| echo "Cleaning up deployment: ${PR_HASH}/" | ||
| azcopy remove "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/" \ | ||
| --recursive || echo "Cleanup completed (some files may not exist)" | ||
| echo "Cleanup completed for PR deployment: ${PR_HASH}/" | ||
| build_and_deploy_job: | ||
| if: github.event_name == 'pull_request' && github.event.action != 'closed' | ||
| runs-on: ubuntu-latest | ||
| name: Build and Deploy Job | ||
| outputs: | ||
| doc_url: ${{ steps.deploy.outputs.first-gen-docs_url }} | ||
| steps: | ||
| ## --- SETUP --- ## | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Use Node LTS version | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: yarn | ||
|
|
||
| - name: Enable Corepack | ||
| run: corepack enable | ||
|
|
||
| - name: Generate PR hash | ||
| id: pr_hash | ||
| run: | | ||
| # Use just PR number so each commit overwrites the previous deployment | ||
| pr_hash="pr-${{ github.event.pull_request.number }}" | ||
| echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" | ||
| echo "Generated PR hash: ${pr_hash}" | ||
| ## --- YARN CACHE --- ## | ||
| - name: Check for cached dependencies | ||
| continue-on-error: true | ||
| id: cache-dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| .cache/yarn | ||
| node_modules | ||
| key: ubuntu-latest-node20-${{ hashFiles('yarn.lock', 'package.json') }} | ||
|
|
||
| ## --- INSTALL & BUILD --- ## | ||
| - name: Install dependencies | ||
| shell: bash | ||
| run: yarn install --immutable | ||
|
|
||
| - name: Build all generations | ||
| run: yarn build | ||
|
|
||
| - name: Generate Custom Elements Manifest | ||
| run: yarn workspace @spectrum-web-components/1st-gen docs:analyze | ||
|
|
||
| - name: Move CEM to Storybook directory | ||
| run: cp 1st-gen/projects/documentation/custom-elements.json 1st-gen/storybook/ | ||
|
|
||
| - name: Build documentation with path prefix | ||
| env: | ||
| SWC_DIR: ${{ steps.pr_hash.outputs.hash }}/docs/first-gen-docs | ||
| run: | | ||
| yarn workspace @spectrum-web-components/1st-gen docs:build | ||
| - name: Build first-gen Storybook | ||
| run: yarn workspace @spectrum-web-components/1st-gen storybook:build | ||
|
|
||
| - name: Build second-gen Storybook | ||
| run: yarn workspace @spectrum-web-components/2nd-gen storybook:build | ||
|
|
||
| ## --- DEPLOY TO AZURE BLOB STORAGE --- ## | ||
| - name: Setup AzCopy | ||
| uses: ./.github/actions/setup-azcopy | ||
|
|
||
| - name: Deploy to Azure Blob Storage | ||
| id: deploy | ||
| env: | ||
| PR_HASH: ${{ steps.pr_hash.outputs.hash }} | ||
| run: | | ||
| # Upload documentation | ||
| echo "Uploading first-gen documentation to ${PR_HASH}/docs/first-gen-docs/" | ||
| azcopy copy "1st-gen/projects/documentation/dist/*" \ | ||
| "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-docs/" \ | ||
| --recursive \ | ||
| --from-to LocalBlob | ||
| # Upload first-gen Storybook | ||
| echo "Uploading first-gen Storybook to ${PR_HASH}/docs/first-gen-storybook/" | ||
| azcopy copy "1st-gen/projects/documentation/dist/storybook/*" \ | ||
marissahuysentruyt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/first-gen-storybook/" \ | ||
| --recursive \ | ||
| --from-to LocalBlob | ||
| # Upload second-gen Storybook | ||
| echo "Uploading second-gen Storybook to ${PR_HASH}/docs/second-gen-storybook/" | ||
| azcopy copy "2nd-gen/packages/swc/storybook-static/*" \ | ||
| "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/docs/second-gen-storybook/" \ | ||
| --recursive \ | ||
| --from-to LocalBlob | ||
| # Set output URLs | ||
| echo "Setting first_gen_docs_url..." | ||
| first_gen_docs_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-docs" | ||
| echo "first_gen_docs_url=${first_gen_docs_url}" >> "$GITHUB_OUTPUT" | ||
| echo "Setting first_gen_storybook_url..." | ||
| first_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/first-gen-storybook" | ||
| echo "first_gen_storybook_url=${first_gen_storybook_url}" >> "$GITHUB_OUTPUT" | ||
| echo "Setting second_gen_storybook_url..." | ||
| second_gen_storybook_url="https://swcpreviews.z13.web.core.windows.net/${PR_HASH}/docs/second-gen-storybook" | ||
| echo "second_gen_storybook_url=${second_gen_storybook_url}" >> "$GITHUB_OUTPUT" | ||
| echo "Deployed to: ${first_gen_docs_url}" | ||
| echo "Deployed to: ${first_gen_storybook_url}" | ||
| echo "Deployed to: ${second_gen_storybook_url}" | ||
| close_pull_request_job: | ||
| if: github.event_name == 'pull_request' && github.event.action == 'closed' | ||
| runs-on: ubuntu-latest | ||
| name: Clean up PR deployment | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Generate PR hash | ||
| id: pr_hash | ||
| run: | | ||
| # Create the same hash as in the deploy job | ||
| pr_hash="pr-${{ github.event.pull_request.number }}" | ||
| echo "hash=${pr_hash}" >> "$GITHUB_OUTPUT" | ||
| - name: Setup AzCopy | ||
| uses: ./.github/actions/setup-azcopy | ||
|
|
||
| - name: Clean up PR deployment | ||
| env: | ||
| PR_HASH: ${{ steps.pr_hash.outputs.hash }} | ||
| run: | | ||
| echo "Cleaning up deployment: ${PR_HASH}/" | ||
| azcopy remove "https://swcpreviews.blob.core.windows.net/\$web/${PR_HASH}/" \ | ||
| --recursive || echo "Cleanup completed (some files may not exist)" | ||
| echo "Cleanup completed for PR deployment: ${PR_HASH}/" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think the preview docs action was failing because of all of the whitespace/indentations in this file? (yaml is white space-sensitive, correct?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ill investigate why my system is applying the white space. thats for calling this out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it linting updates? That's just sort of what it looks like to me. 🤷♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah its definitely linting related but not sure why its getting applied now. ill check other yaml files too because those didnt get effected the same maybe?