Skip to content

build: deploy examples to GitHub pages on main runs #12

build: deploy examples to GitHub pages on main runs

build: deploy examples to GitHub pages on main runs #12

Workflow file for this run

name: Build
on:
push:
branches:
- main
- maintenance/*
- next
pull_request:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # We need this for commit-lint
- uses: actions/setup-node@v4
with:
node-version: lts/jod
cache: 'npm'
- run: npm config set //code.siemens.com/api/v4/packages/npm/:_authToken $SIEMENS_NPM_TOKEN
env:
SIEMENS_NPM_TOKEN: ${{ secrets.SIEMENS_NPM_TOKEN }}
- run: npm ci --prefer-offline --no-audit --include=optional
- run: npm run lint:commit
- run: npm run build:all
- run: npm run build:examples
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
test:
runs-on: ubuntu-22.04
# We use playwright browser to run karma tests
container: mcr.microsoft.com/playwright:v1.52.0-noble
env:
# See: https://github.com/microsoft/playwright/issues/27620
HOME: /root
needs:
- build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/jod
cache: 'npm'
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- run: npm ci --prefer-offline --no-audit
- run: npm run lint:format
- run: npm run lint:ng
- run: npm run translate:test -- --watch=false --progress=false --code-coverage
- run: npm run lib:test -- --watch=false --progress=false --code-coverage
# TODO: Upload coverage reports
aot:
runs-on: ubuntu-22.04
needs:
- build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/jod
cache: 'npm'
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- run: npm config set //code.siemens.com/api/v4/packages/npm/:_authToken $SIEMENS_NPM_TOKEN
env:
SIEMENS_NPM_TOKEN: ${{ secrets.SIEMENS_NPM_TOKEN }}
- run: npm ci --prefer-offline --no-audit --include=optional
- run: npm run build:examples:aot
- run: npm run build:all:update-translatable-keys
- run: git diff --exit-code "projects/**/*-translatable-keys.interface.ts"
documentation:
runs-on: ubuntu-22.04
needs:
- build
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- run: uv run mkdocs build
env:
UV_INDEX_CODE_DOCS_THEME_USERNAME: ${{ secrets.SIEMENS_NPM_USER }}
UV_INDEX_CODE_DOCS_THEME_PASSWORD: ${{ secrets.SIEMENS_NPM_TOKEN }}
EXAMPLES_BASE: /element-examples
- run: mv dist/element-examples/ dist/design/
- uses: actions/upload-artifact@v4
with:
name: pages
path: dist/design
publish-documentation:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-22.04
permissions:
pages: write
id-token: write
needs:
- documentation
steps:
- uses: actions/configure-pages@v5
- uses: actions/download-artifact@v4
with:
name: pages
path: dist/design
- uses: actions/upload-pages-artifact@v3
with:
path: 'dist/design'
- uses: actions/deploy-pages@v4
# TODO: add release job
# TODO: build PR previews
# TODO: e2e test