Skip to content

Commit

Permalink
Merge branch 'docs/getting-started-for-designers' of https://github.c…
Browse files Browse the repository at this point in the history
…om/digdir/designsystemet into docs/getting-started-for-designers
  • Loading branch information
mrosvik committed Jun 6, 2024
2 parents 5a4657b + 72a1cfe commit 1d48d01
Show file tree
Hide file tree
Showing 50 changed files with 9,290 additions and 8,326 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/check-storefront.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# Runs conventional commit check on PR
name: Checks storefront
name: Checks Storefront
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'apps/storefront/**'
push:
branches:
- main
paths:
- 'apps/storefront/**'
jobs:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/checks-packages.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Runs conventional commit check on PR
name: Checks packages
name: Checks Packages
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'packages/**'
- '*.*js'
push:
branches:
- main
paths:
- 'packages/**'
jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/conventional-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
- next
types:
- opened
- edited
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Development Production
name: Deploy Development
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DEVELOPMENT }}
Expand All @@ -7,6 +7,7 @@ on:
push:
branches:
- main
- next
paths:
- 'apps/dev/**'
jobs:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/deploy-storefront.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy Storefront
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_STOREFRONT }}
on:
workflow_dispatch:
inputs:
environment:
type: choice
default: next
description: Deploy to environment
options:
- production
- next
push:
branches:
- next
paths:
- 'apps/storefront/**'
jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Use node 20 and yarn cache
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Install Vercel CLI
run: yarn add vercel@latest

- name: Set default environment value if push event is triggered
id: defaultenvironment
run: |
ENVIRONMENT=${{ github.event.inputs.environment }}
echo "value=${ENVIRONMENT:-"next"}" >> "$GITHUB_OUTPUT"
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=${{(steps.defaultenvironment.outputs.value == 'next' && 'preview') || 'production'}} --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build ${{(steps.defaultenvironment.outputs.value == 'production' && '--prod') || ''}} --token=${{ secrets.VERCEL_TOKEN }}

- id: deploy
name: Deploy Project Artifacts to Vercel
run: echo "url=$(vercel deploy --prebuilt ${{(steps.defaultenvironment.outputs.value == 'production' && '--prod') || ''}} --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_OUTPUT

- name: Set Vercel alias
run: vercel alias --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_TEAM }} set ${{ steps.deploy.outputs.url }} next.designsystemet.no
if: steps.defaultenvironment.outputs.value == 'next'
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
inputs:
environment:
type: choice
default: next
description: Deploy to environment
options:
- production
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/deploy-theme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Deploy Theme
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_THEME }}
on:
workflow_dispatch:
inputs:
environment:
type: choice
default: next
description: Deploy to environment
options:
- production
- next
pull_request:
types: [opened, synchronize]
paths:
- 'apps/theme/**'
push:
branches:
- next
paths:
- 'apps/theme/**'
jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Use node 20 and yarn cache
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Install Vercel CLI
run: yarn add vercel@latest

- name: Set default environment value if push event is triggered
id: defaultenvironment
run: |
ENVIRONMENT=${{ github.event.inputs.environment }}
echo "value=${ENVIRONMENT:-"next"}" >> "$GITHUB_OUTPUT"
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=${{(steps.defaultenvironment.outputs.value == 'next' && 'preview') || 'production'}} --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build ${{(steps.defaultenvironment.outputs.value == 'production' && '--prod') || ''}} --token=${{ secrets.VERCEL_TOKEN }}

- id: deploy
name: Deploy Project Artifacts to Vercel
run: echo "url=$(vercel deploy --prebuilt ${{(steps.defaultenvironment.outputs.value == 'production' && '--prod') || ''}} --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_OUTPUT

- name: Set Vercel alias
run: vercel alias --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_TEAM }} set ${{ steps.deploy.outputs.url }} next.theme.designsystemet.no
if: steps.defaultenvironment.outputs.value == 'next'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Storefront Preview
name: Deploy Storefront PR
env:
VERCEL_TEAM: ${{ secrets.VERCEL_TEAM }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Storybook PR Preview
name: Deploy Storybook PR
env:
VERCEL_TEAM: ${{ secrets.VERCEL_TEAM }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/storefront-deploy.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/theme-deploy.yml

This file was deleted.

6 changes: 5 additions & 1 deletion apps/storefront/components/ImageBanner/ImageBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @next/next/no-img-element */
import type React from 'react';
import type { ButtonProps } from '@digdir/designsystemet-react';
import { useEffect, useState, createElement } from 'react';
import cn from 'clsx';
import { Link, Button } from '@digdir/designsystemet-react';
Expand Down Expand Up @@ -33,6 +34,8 @@ type ImageSectionButtonProps = {
text: string;
prefix?: React.ReactNode;
href: string;
variant?: ButtonProps['variant'];
color?: ButtonProps['color'];
};

const ImageBanner = ({
Expand Down Expand Up @@ -126,7 +129,8 @@ const ImageBanner = ({
<Button
key={index}
asChild
variant='secondary'
variant={item.variant ?? 'secondary'}
color={item.color}
>
<a
href={item.href}
Expand Down
1 change: 1 addition & 0 deletions apps/storefront/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default ({ children }) => <FrontpageLayout content={children} />;
text: 'Bli med på Slack',
href: 'https://join.slack.com/t/designsystemet/shared_invite/zt-2438eotl3-a4266Vd2IeqMWO8TBw5PrQ',
prefix: <PersonChatIcon fontSize={24} />,
variant: 'primary'
},
{
text: 'Bidra på GitHub',
Expand Down
Loading

0 comments on commit 1d48d01

Please sign in to comment.