Skip to content
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
18 changes: 1 addition & 17 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ permissions:
actions: read
contents: read
security-events: write
deployments: write

jobs:
build:
Expand All @@ -27,19 +26,4 @@ jobs:
uses: cloudscape-design/actions/.github/workflows/build-lint-test.yml@main
secrets: inherit
with:
artifact-path: pages/lib/static-default
artifact-name: dev-pages-react${{ matrix.react }}
react-version: ${{ matrix.react }}
deploy:
needs: build
name: deploy${{ matrix.react != 16 && format(' (React {0})', matrix.react) || '' }}
# skip this job for external contributions as they aren't supported and cause the job's failure
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
strategy:
matrix:
react: [16, 18]
uses: cloudscape-design/actions/.github/workflows/deploy.yml@main
secrets: inherit
with:
artifact-name: dev-pages-react${{ matrix.react }}
deployment-path: pages/lib/static-default
react-version: ${{ matrix.react }}
67 changes: 67 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Deploy

on:
pull_request:
branches:
- main

permissions:
id-token: write
actions: read
contents: read
deployments: write

jobs:
# Quick build: compiles source and bundles dev pages without running tests.
# Produces the artifact consumed by deploy, allowing it to start
# before the full build+test job finishes.
quick-build:
name: quick-build${{ matrix.react != 16 && format(' (React {0})', matrix.react) || '' }}
# skip this job for external contributions
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
strategy:
matrix:
react: [16, 18]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm i

- name: Quick build
run: npm run quick-build
env:
NODE_ENV: production
REACT_VERSION: ${{ matrix.react }}

- name: Bundle dev pages
run: node_modules/.bin/webpack --config pages/webpack.config.integ.cjs --output-path pages/lib/static-default
env:
NODE_ENV: production
REACT_VERSION: ${{ matrix.react }}

- name: Upload dev pages artifact
uses: actions/upload-artifact@v4
with:
name: dev-pages-react${{ matrix.react }}
path: pages/lib/static-default

deploy:
needs: quick-build
name: deploy${{ matrix.react != 16 && format(' (React {0})', matrix.react) || '' }}
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
strategy:
matrix:
react: [16, 18]
uses: cloudscape-design/actions/.github/workflows/deploy.yml@main
secrets: inherit
with:
artifact-name: dev-pages-react${{ matrix.react }}
deployment-path: pages/lib/static-default
Loading