feat: add tokens for NL Design System Candidate components #6477
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: Continuous Delivery | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
CI: true | |
MAIN_BRANCH: "main" | |
jobs: | |
install: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install pnpm | |
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0.0 | |
- name: Set up Node.js version | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
- name: Install dependencies | |
run: | | |
pnpm install | |
pnpm ls --recursive | |
lint: | |
runs-on: ubuntu-latest | |
needs: install | |
env: | |
NODE_OPTIONS: "--max-old-space-size=6114" | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install pnpm | |
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0.0 | |
- name: Set up Node.js version | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
- name: Install dependencies | |
run: | | |
pnpm install | |
- name: "Continuous Integration: lint" | |
run: | | |
pnpm run --if-present lint | |
build: | |
runs-on: ubuntu-latest | |
needs: install | |
env: | |
NODE_OPTIONS: "--max-old-space-size=6114" | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install pnpm | |
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0.0 | |
- name: Set up Node.js version | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
- name: Install dependencies | |
run: | | |
pnpm install --frozen-lockfile | |
- name: "Continuous Integration: build" | |
env: | |
BASE_URL: "/utrecht/" | |
STORYBOOK_PDF_FILES_BASE_URL: "https://raw.githubusercontent.com/nl-design-system/utrecht-pdf/refs/heads/main/" | |
run: | | |
pnpm run --if-present build | |
- name: "Continuous Integration: lint build" | |
run: | | |
pnpm run --if-present lint-build | |
- name: "Continuous Integration: test build" | |
run: | | |
pnpm run --if-present test-build | |
- name: "Continuous Integration: Git status" | |
shell: bash | |
run: | | |
if git diff --no-ext-diff --quiet --exit-code ; then | |
echo "No unstaged changes that would prevent 'npm publish'" | |
exit 0 | |
else | |
echo "The following unstaged changes occur after the build step. Add the files to Git or specify the paths in '.gitignore' to proceed." | |
git diff --exit-code | |
exit 1 | |
fi | |
- name: Upload artifact for GitHub Pages | |
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 | |
if: github.ref == 'refs/heads/main' | |
with: | |
path: packages/design-system-website/dist/ | |
- name: "Retain build artifact: website" | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: website | |
path: packages/design-system-website/dist/ | |
retention-days: 1 | |
- name: "Retain build artifact: storybook" | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: storybook | |
path: packages/storybook/dist/ | |
retention-days: 1 | |
test: | |
runs-on: ubuntu-latest | |
needs: install | |
env: | |
NODE_OPTIONS: "--max-old-space-size=6114" | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install pnpm | |
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0.0 | |
- name: Set up Node.js version | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
- name: Install dependencies | |
run: | | |
pnpm install | |
- name: "Continuous Integration: test" | |
run: | | |
pnpm run --if-present test | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
visual-regression-test: | |
runs-on: ubuntu-latest | |
needs: install | |
env: | |
NODE_OPTIONS: "--max-old-space-size=6114" | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0.0 | |
- name: Set up Node.js version | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
- name: Install dependencies | |
run: | | |
pnpm install | |
- name: "Continuous Integration: build Storybook with animation disabled" | |
env: | |
STORYBOOK_REDUCED_MOTION: 1 | |
run: | | |
pnpm run --if-present build | |
- name: Publish to Chromatic | |
uses: chromaui/action@30b6228aa809059d46219e0f556752e8672a7e26 # v11.11.0 | |
if: github.event.pull_request.draft == false | |
with: | |
autoAcceptChanges: ${{ env.MAIN_BRANCH }} | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
storybookBuildDir: packages/storybook-css/dist/ | |
publish-website: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/main' | |
environment: | |
name: github-pages | |
url: ${{ steps.deploy-pages.outputs.page_url }} | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deploy-pages | |
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 | |
publish-npm: | |
runs-on: ubuntu-latest | |
needs: [lint, test] | |
if: github.ref == 'refs/heads/main' | |
env: | |
NODE_OPTIONS: "--max-old-space-size=6114" | |
steps: | |
- name: Checkout release branch | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Install pnpm | |
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0.0 | |
- name: Set up Node.js version | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
- name: "Continuous Deployment: install" | |
run: | | |
pnpm install | |
pnpm ls --recursive | |
- name: "Continuous Deployment: build" | |
run: | | |
pnpm run --if-present build | |
# - name: "Continuous Deployment: publish to GitHub repository" | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
# GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
# GIT_AUTHOR_NAME: "NL Design System" | |
# GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | |
# GIT_COMMITTER_NAME: "NL Design System" | |
# MAIN_BRANCH: | |
# run: | | |
# git push --set-upstream origin HEAD | |
# pnpm run release | |
- name: "Continuous Deployment: publish changeset to GitHub repository" | |
uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9 | |
id: changeset | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
GIT_AUTHOR_NAME: "NL Design System" | |
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | |
GIT_COMMITTER_NAME: "NL Design System" | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
with: | |
commit: "docs(release): design system packages" | |
setupGitUser: false | |
title: "docs(release): design system packages" | |
publish: "pnpm run publish:changeset" | |
# - name: "Continuous Deployment: publish to npm" | |
# env: | |
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# run: | | |
# pnpm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}" | |
# pnpm run publish | |
# pnpm config delete "//registry.npmjs.org/:_authToken" |