ci: Add release workflows for docs and www
This commit is contained in:
11 files changed
+621
-131
No files matched your search
@@ -12,8 +12,8 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup-stage:
|
||||||
name: Setup stage
|
name: Setup - Stage
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
cache-hit: ${{ steps.cache-pnpm-store.outputs.cache-hit }}
|
cache-hit: ${{ steps.cache-pnpm-store.outputs.cache-hit }}
|
||||||
@@ -42,47 +42,9 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
lint:
|
|
||||||
name: Lint STL
|
|
||||||
needs: [setup, build-configs]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 9.12.3
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: 'pnpm'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
- name: Lint STL package
|
|
||||||
run: pnpm --filter @ermnvldmr/stl lint
|
|
||||||
|
|
||||||
type-check:
|
|
||||||
name: Typecheck STL
|
|
||||||
needs: [setup, build-configs]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 9.12.3
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: 'pnpm'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
- name: Typecheck STL package
|
|
||||||
run: pnpm --filter @ermnvldmr/stl typecheck
|
|
||||||
|
|
||||||
build-configs:
|
build-configs:
|
||||||
name: Build Config Packages
|
name: Build - Configs
|
||||||
needs: setup
|
needs: setup-stage
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -101,9 +63,47 @@ jobs:
|
|||||||
- name: Build Vite config
|
- name: Build Vite config
|
||||||
run: pnpm --filter @ermnvldmr/vite-config build
|
run: pnpm --filter @ermnvldmr/vite-config build
|
||||||
|
|
||||||
test:
|
lint-stl:
|
||||||
name: Test STL
|
name: Lint - STL
|
||||||
needs: [setup, build-configs]
|
needs: build-configs
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9.12.3
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
- name: Lint STL package
|
||||||
|
run: pnpm --filter @ermnvldmr/stl lint
|
||||||
|
|
||||||
|
typecheck-stl:
|
||||||
|
name: Typecheck - STL
|
||||||
|
needs: build-configs
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9.12.3
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
- name: Typecheck STL package
|
||||||
|
run: pnpm --filter @ermnvldmr/stl typecheck
|
||||||
|
|
||||||
|
test-stl:
|
||||||
|
name: Test - STL
|
||||||
|
needs: build-configs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -131,9 +131,9 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
build:
|
build-stl:
|
||||||
name: Build STL Package
|
name: Build - STL
|
||||||
needs: [setup, build-configs]
|
needs: build-configs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup-stage:
|
||||||
name: Setup stage
|
name: Setup - Stage
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
cache-hit: ${{ steps.cache-pnpm-store.outputs.cache-hit }}
|
cache-hit: ${{ steps.cache-pnpm-store.outputs.cache-hit }}
|
||||||
@@ -43,51 +43,9 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
lint:
|
|
||||||
name: Lint UI & Dependencies
|
|
||||||
needs: [setup, build-configs]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 9.12.3
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: 'pnpm'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
- name: Lint STL package
|
|
||||||
run: pnpm --filter @ermnvldmr/stl lint
|
|
||||||
- name: Lint UI package
|
|
||||||
run: pnpm --filter @ermnvldmr/ui lint
|
|
||||||
|
|
||||||
type-check:
|
|
||||||
name: Typecheck UI & Dependencies
|
|
||||||
needs: [setup, build-configs]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 9.12.3
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: 'pnpm'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
- name: Typecheck STL package
|
|
||||||
run: pnpm --filter @ermnvldmr/stl typecheck
|
|
||||||
- name: Typecheck UI package
|
|
||||||
run: pnpm --filter @ermnvldmr/ui typecheck
|
|
||||||
|
|
||||||
build-configs:
|
build-configs:
|
||||||
name: Build Config Packages
|
name: Build - Configs
|
||||||
needs: setup
|
needs: setup-stage
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -109,8 +67,8 @@ jobs:
|
|||||||
run: pnpm --filter @ermnvldmr/storybook-config build
|
run: pnpm --filter @ermnvldmr/storybook-config build
|
||||||
|
|
||||||
build-dependencies:
|
build-dependencies:
|
||||||
name: Build Dependencies (STL)
|
name: Build - Dependencies
|
||||||
needs: [setup, build-configs]
|
needs: build-configs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -133,9 +91,51 @@ jobs:
|
|||||||
- name: Build STL package
|
- name: Build STL package
|
||||||
run: pnpm --filter @ermnvldmr/stl build
|
run: pnpm --filter @ermnvldmr/stl build
|
||||||
|
|
||||||
test:
|
lint-ui:
|
||||||
name: Test UI & Dependencies
|
name: Lint - UI
|
||||||
needs: [setup, build-dependencies]
|
needs: build-dependencies
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9.12.3
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
- name: Lint STL package
|
||||||
|
run: pnpm --filter @ermnvldmr/stl lint
|
||||||
|
- name: Lint UI package
|
||||||
|
run: pnpm --filter @ermnvldmr/ui lint
|
||||||
|
|
||||||
|
typecheck-ui:
|
||||||
|
name: Typecheck - UI
|
||||||
|
needs: build-dependencies
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9.12.3
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
- name: Typecheck STL package
|
||||||
|
run: pnpm --filter @ermnvldmr/stl typecheck
|
||||||
|
- name: Typecheck UI package
|
||||||
|
run: pnpm --filter @ermnvldmr/ui typecheck
|
||||||
|
|
||||||
|
test-ui:
|
||||||
|
name: Test - UI & Storybook
|
||||||
|
needs: build-dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -169,9 +169,9 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
storybook-build:
|
build-storybook:
|
||||||
name: Build UI Storybook
|
name: Build - Storybook
|
||||||
needs: [setup, build-dependencies]
|
needs: build-dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -198,9 +198,9 @@ jobs:
|
|||||||
- name: Build UI Storybook
|
- name: Build UI Storybook
|
||||||
run: pnpm --filter @ermnvldmr/ui build-storybook
|
run: pnpm --filter @ermnvldmr/ui build-storybook
|
||||||
|
|
||||||
build:
|
build-ui:
|
||||||
name: Build UI Package
|
name: Build - UI
|
||||||
needs: [setup, build-dependencies]
|
needs: build-dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup-hugo:
|
||||||
name: Setup Hugo
|
name: Setup - Hugo
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -27,9 +27,9 @@ jobs:
|
|||||||
hugo-version: 'latest'
|
hugo-version: 'latest'
|
||||||
extended: true
|
extended: true
|
||||||
|
|
||||||
build:
|
build-hugo:
|
||||||
name: Build Hugo Site
|
name: Build - Hugo Site
|
||||||
needs: setup
|
needs: setup-hugo
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -47,3 +47,41 @@ jobs:
|
|||||||
- name: Build Hugo site
|
- name: Build Hugo site
|
||||||
working-directory: services/docs
|
working-directory: services/docs
|
||||||
run: hugo --gc --minify
|
run: hugo --gc --minify
|
||||||
|
|
||||||
|
release-docker:
|
||||||
|
name: Release - Docker Image
|
||||||
|
needs: build-hugo
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Log in to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract Docker metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ghcr.io/${{ github.repository }}/docs
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest
|
||||||
|
type=sha,format=short
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ci/docker/docs/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
name: services/www - next/checkout-release-branch
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
workflow-create-release-branch:
|
||||||
|
name: Workflow - Create Release Branch
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Determine Branch Name
|
||||||
|
id: branch
|
||||||
|
run: |
|
||||||
|
BRANCH_NAME=$(bash ci/scripts/semantic-release.sh checkout services/www)
|
||||||
|
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Create and Push Branch
|
||||||
|
run: |
|
||||||
|
git checkout -b ${{ steps.branch.outputs.branch_name }}
|
||||||
|
git push origin ${{ steps.branch.outputs.branch_name }}
|
||||||
@@ -14,8 +14,8 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup-stage:
|
||||||
name: Setup stage
|
name: Setup - Stage
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
cache-hit: ${{ steps.cache-pnpm-store.outputs.cache-hit }}
|
cache-hit: ${{ steps.cache-pnpm-store.outputs.cache-hit }}
|
||||||
@@ -45,8 +45,8 @@ jobs:
|
|||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
build-configs:
|
build-configs:
|
||||||
name: Build Config Packages
|
name: Build - Configs
|
||||||
needs: setup
|
needs: setup-stage
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -68,8 +68,8 @@ jobs:
|
|||||||
run: pnpm --filter @ermnvldmr/storybook-config build
|
run: pnpm --filter @ermnvldmr/storybook-config build
|
||||||
|
|
||||||
build-dependencies:
|
build-dependencies:
|
||||||
name: Build Dependencies (STL → UI)
|
name: Build - Dependencies
|
||||||
needs: [setup, build-configs]
|
needs: build-configs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -94,9 +94,9 @@ jobs:
|
|||||||
- name: Build UI package
|
- name: Build UI package
|
||||||
run: pnpm --filter @ermnvldmr/ui build
|
run: pnpm --filter @ermnvldmr/ui build
|
||||||
|
|
||||||
lint:
|
lint-www:
|
||||||
name: Lint WWW & Dependencies
|
name: Lint - WWW & Deps
|
||||||
needs: [setup, build-configs]
|
needs: build-dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -117,9 +117,9 @@ jobs:
|
|||||||
- name: Lint WWW service
|
- name: Lint WWW service
|
||||||
run: pnpm --filter @ermnvldmr/www lint
|
run: pnpm --filter @ermnvldmr/www lint
|
||||||
|
|
||||||
type-check:
|
typecheck-www:
|
||||||
name: Typecheck WWW & Dependencies
|
name: Typecheck - WWW & Deps
|
||||||
needs: [setup, build-configs]
|
needs: build-dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -140,9 +140,9 @@ jobs:
|
|||||||
- name: Typecheck WWW service
|
- name: Typecheck WWW service
|
||||||
run: pnpm --filter @ermnvldmr/www typecheck
|
run: pnpm --filter @ermnvldmr/www typecheck
|
||||||
|
|
||||||
storybook-build:
|
build-storybook:
|
||||||
name: Build Storybook
|
name: Build - Storybook
|
||||||
needs: [setup, build-dependencies]
|
needs: build-dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -175,9 +175,9 @@ jobs:
|
|||||||
path: services/www/storybook-static/
|
path: services/www/storybook-static/
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
test:
|
test-www:
|
||||||
name: Test
|
name: Test - WWW & Storybook
|
||||||
needs: [setup, storybook-build]
|
needs: build-storybook
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -224,9 +224,9 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
build:
|
build-www:
|
||||||
name: Build WWW Service
|
name: Build - WWW Service
|
||||||
needs: [setup, build-dependencies]
|
needs: build-dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -252,3 +252,39 @@ jobs:
|
|||||||
run: pnpm --filter @ermnvldmr/ui build
|
run: pnpm --filter @ermnvldmr/ui build
|
||||||
- name: Build WWW service
|
- name: Build WWW service
|
||||||
run: pnpm --filter @ermnvldmr/www build
|
run: pnpm --filter @ermnvldmr/www build
|
||||||
|
|
||||||
|
release-docker:
|
||||||
|
name: Release - Docker Image
|
||||||
|
needs: build-www
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Log in to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract Docker metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ghcr.io/${{ github.repository }}/www
|
||||||
|
tags: |
|
||||||
|
type=raw,value=next
|
||||||
|
type=sha,format=short
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ci/docker/www/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
name: services/www - releases/dispatch-release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-tag-docker:
|
||||||
|
name: Release - Tag & Docker
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Calculate Release Version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
RELEASE_VERSION=$(bash ci/scripts/semantic-release.sh release ${{ github.ref_name }})
|
||||||
|
# Extract MAJOR.MINOR for tagging
|
||||||
|
MAJOR_MINOR=$(echo "${{ github.ref_name }}" | cut -d/ -f3 | sed 's/^v//')
|
||||||
|
MAJOR=$(echo "$MAJOR_MINOR" | cut -d. -f1)
|
||||||
|
echo "version=$RELEASE_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "major_minor=$MAJOR_MINOR" >> $GITHUB_OUTPUT
|
||||||
|
echo "major=$MAJOR" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Create and Push Tag
|
||||||
|
run: |
|
||||||
|
TAG_NAME="releases/www/v${{ steps.version.outputs.version }}"
|
||||||
|
git tag $TAG_NAME
|
||||||
|
git push origin $TAG_NAME
|
||||||
|
|
||||||
|
- name: Log in to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract Docker metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ghcr.io/${{ github.repository }}/www
|
||||||
|
tags: |
|
||||||
|
type=raw,value=v${{ steps.version.outputs.version }}
|
||||||
|
type=raw,value=v${{ steps.version.outputs.major_minor }}
|
||||||
|
type=raw,value=v${{ steps.version.outputs.major }}
|
||||||
|
type=raw,value=latest
|
||||||
|
type=sha,format=short
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ci/docker/www/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
name: services/www - releases/required
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ['releases/www/**']
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ci-www-rel-${{ github.ref_name }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
setup-stage:
|
||||||
|
name: Setup - Stage
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9.12.3
|
||||||
|
- name: Setup Node.js with pnpm cache
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
build-configs:
|
||||||
|
name: Build - Configs
|
||||||
|
needs: setup-stage
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9.12.3
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
- name: Build configs
|
||||||
|
run: |
|
||||||
|
pnpm --filter @ermnvldmr/jest-config build
|
||||||
|
pnpm --filter @ermnvldmr/vite-config build
|
||||||
|
pnpm --filter @ermnvldmr/storybook-config build
|
||||||
|
|
||||||
|
build-dependencies:
|
||||||
|
name: Build - Dependencies
|
||||||
|
needs: build-configs
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9.12.3
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
- name: Build dependencies
|
||||||
|
run: |
|
||||||
|
pnpm --filter @ermnvldmr/jest-config build
|
||||||
|
pnpm --filter @ermnvldmr/vite-config build
|
||||||
|
pnpm --filter @ermnvldmr/storybook-config build
|
||||||
|
pnpm --filter @ermnvldmr/stl build
|
||||||
|
pnpm --filter @ermnvldmr/ui build
|
||||||
|
|
||||||
|
test-www:
|
||||||
|
name: Test - WWW & Deps
|
||||||
|
needs: build-dependencies
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9.12.3
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
- name: Build dependencies
|
||||||
|
run: |
|
||||||
|
pnpm --filter @ermnvldmr/jest-config build
|
||||||
|
pnpm --filter @ermnvldmr/vite-config build
|
||||||
|
pnpm --filter @ermnvldmr/storybook-config build
|
||||||
|
pnpm --filter @ermnvldmr/stl build
|
||||||
|
pnpm --filter @ermnvldmr/ui build
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
pnpm --filter @ermnvldmr/stl test:coverage
|
||||||
|
pnpm --filter @ermnvldmr/ui test:coverage
|
||||||
|
pnpm --filter @ermnvldmr/www test:coverage
|
||||||
|
|
||||||
|
build-www:
|
||||||
|
name: Build - WWW Service
|
||||||
|
needs: build-dependencies
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9.12.3
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
- name: Build WWW service
|
||||||
|
run: |
|
||||||
|
pnpm --filter @ermnvldmr/jest-config build
|
||||||
|
pnpm --filter @ermnvldmr/vite-config build
|
||||||
|
pnpm --filter @ermnvldmr/storybook-config build
|
||||||
|
pnpm --filter @ermnvldmr/stl build
|
||||||
|
pnpm --filter @ermnvldmr/ui build
|
||||||
|
pnpm --filter @ermnvldmr/www build
|
||||||
|
|
||||||
|
release-rc-docker:
|
||||||
|
name: Release - RC Docker Image
|
||||||
|
needs: build-www
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Log in to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Calculate RC Version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
RC_VERSION=$(bash ci/scripts/semantic-release.sh rc ${{ github.ref_name }})
|
||||||
|
echo "rc_version=$RC_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Extract Docker metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ghcr.io/${{ github.repository }}/www
|
||||||
|
tags: |
|
||||||
|
type=raw,value=${{ steps.version.outputs.rc_version }}
|
||||||
|
type=sha,format=short
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ci/docker/www/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
# Gzip compression
|
||||||
|
gzip on;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_proxied any;
|
||||||
|
gzip_comp_level 6;
|
||||||
|
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
|
||||||
|
|
||||||
|
# Clean URLs (remove .html from URI)
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ $uri.html /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Cache static assets
|
||||||
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||||
|
expires 1y;
|
||||||
|
add_header Cache-Control "public, no-transform";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Error pages
|
||||||
|
error_page 404 /404.html;
|
||||||
|
location = /404.html {
|
||||||
|
internal;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Stage 1: Build
|
||||||
|
FROM klakegg/hugo:ext-alpine AS builder
|
||||||
|
|
||||||
|
WORKDIR /src
|
||||||
|
COPY services/docs /src
|
||||||
|
|
||||||
|
RUN hugo --gc --minify
|
||||||
|
|
||||||
|
# Stage 2: Runtime
|
||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
COPY --from=builder /src/public /usr/share/nginx/html
|
||||||
|
COPY ci/config/nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# Stage 1: Build
|
||||||
|
FROM node:20-alpine AS builder
|
||||||
|
|
||||||
|
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||||
|
RUN apk add --no-cache libc6-compat
|
||||||
|
RUN npm install -g pnpm@9.12.3
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy monorepo configuration
|
||||||
|
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./
|
||||||
|
# Copy all package.json files to allow pnpm to fetch dependencies
|
||||||
|
COPY packages/eslint-config/package.json ./packages/eslint-config/
|
||||||
|
COPY packages/jest-config/package.json ./packages/jest-config/
|
||||||
|
COPY packages/stl/package.json ./packages/stl/
|
||||||
|
COPY packages/storybook-config/package.json ./packages/storybook-config/
|
||||||
|
COPY packages/ui/package.json ./packages/ui/
|
||||||
|
COPY packages/vite-config/package.json ./packages/vite-config/
|
||||||
|
COPY services/www/package.json ./services/www/
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
# Copy source code
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Build dependencies and then the website
|
||||||
|
RUN pnpm --filter @ermnvldmr/jest-config build
|
||||||
|
RUN pnpm --filter @ermnvldmr/vite-config build
|
||||||
|
RUN pnpm --filter @ermnvldmr/stl build
|
||||||
|
RUN pnpm --filter @ermnvldmr/ui build
|
||||||
|
RUN pnpm --filter @ermnvldmr/www build
|
||||||
|
|
||||||
|
# Stage 2: Runtime
|
||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
COPY --from=builder /app/services/www/dist /usr/share/nginx/html
|
||||||
|
COPY ci/config/nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
Executable
+67
@@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
MODE=$1
|
||||||
|
TARGET=$2
|
||||||
|
|
||||||
|
if [ -z "$MODE" ] || [ -z "$TARGET" ]; then
|
||||||
|
echo "Usage: $0 <mode: checkout|rc|release> <target: service_path|branch_name>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $MODE in
|
||||||
|
checkout)
|
||||||
|
SERVICE_PATH=$TARGET
|
||||||
|
SERVICE_NAME=$(basename "$SERVICE_PATH")
|
||||||
|
VERSION=$(node -p "require('./$SERVICE_PATH/package.json').version")
|
||||||
|
MAJOR_MINOR=$(echo "$VERSION" | cut -d. -f1,2)
|
||||||
|
echo "releases/$SERVICE_NAME/v$MAJOR_MINOR"
|
||||||
|
;;
|
||||||
|
rc|release)
|
||||||
|
BRANCH_NAME=$TARGET
|
||||||
|
# Extract service name and major.minor from branch: releases/www/v1.2
|
||||||
|
if [[ ! $BRANCH_NAME =~ ^releases/([^/]+)/v([0-9]+\.[0-9]+)$ ]]; then
|
||||||
|
echo "Error: Branch name must follow 'releases/<service>/v<major>.<minor>' format"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
SERVICE_NAME="${BASH_REMATCH[1]}"
|
||||||
|
MAJOR_MINOR="${BASH_REMATCH[2]}"
|
||||||
|
|
||||||
|
TAG_PREFIX="releases/$SERVICE_NAME/v$MAJOR_MINOR"
|
||||||
|
|
||||||
|
# Ensure we have the latest tags
|
||||||
|
git fetch --tags --quiet
|
||||||
|
|
||||||
|
# Find the latest patch version for this Major.Minor
|
||||||
|
LATEST_TAG=$(git tag -l "$TAG_PREFIX.*" | grep -v "\-rc" | sort -V | tail -n1 || echo "")
|
||||||
|
|
||||||
|
if [ -z "$LATEST_TAG" ]; then
|
||||||
|
PATCH=0
|
||||||
|
else
|
||||||
|
LATEST_VERSION=${LATEST_TAG#"$TAG_PREFIX."}
|
||||||
|
PATCH=$((LATEST_VERSION + 1))
|
||||||
|
fi
|
||||||
|
|
||||||
|
VERSION_TAG="$MAJOR_MINOR.$PATCH"
|
||||||
|
|
||||||
|
if [ "$MODE" == "release" ]; then
|
||||||
|
echo "$VERSION_TAG"
|
||||||
|
else
|
||||||
|
# Find the latest RC for THIS specific version
|
||||||
|
RC_PREFIX="$TAG_PREFIX.$VERSION_TAG-rc"
|
||||||
|
LATEST_RC_TAG=$(git tag -l "$RC_PREFIX.*" | sort -V | tail -n1 || echo "")
|
||||||
|
|
||||||
|
if [ -z "$LATEST_RC_TAG" ]; then
|
||||||
|
RC=1
|
||||||
|
else
|
||||||
|
LATEST_RC=${LATEST_RC_TAG#"$RC_PREFIX."}
|
||||||
|
RC=$((LATEST_RC + 1))
|
||||||
|
fi
|
||||||
|
echo "$VERSION_TAG-rc.$RC"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown mode: $MODE"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
Reference in new issue
Block a user