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
128 changes: 128 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Publish documentation

on:
pull_request:
types: [closed]
branches: ["main", "next"]

permissions:
contents: write
id-token: write
pages: write

concurrency:
group: pages-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build Amicons package
if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == github.repository && (github.event.pull_request.base.ref == 'next' || (github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'docs')))
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Get version
id: version
run: echo "version=$(jq -r '.version' amicons/package.json)" >> $GITHUB_OUTPUT
- name: Set up pnpm
uses: pnpm/action-setup@v5
with:
version: 10.33.0
- name: Set up Node 24
uses: actions/setup-node@v6
with:
node-version: 24.x
cache: "pnpm"
cache-dependency-path: amicons/pnpm-lock.yaml
- name: Install dependencies
working-directory: amicons
run: pnpm install --frozen-lockfile
- name: Production build
working-directory: amicons
run: pnpm prod
- name: Pack for npm
working-directory: amicons
run: pnpm pack
- name: Package icons
working-directory: amicons/icons
run: zip -r ../../amicons-${{ steps.version.outputs.version }}-icons.zip . -i "*.svg"
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: release-artifacts
path: |
amicons/dist
amicons/studio384-amicons-*.tgz
amicons-${{ steps.version.outputs.version }}-icons.zip

docs_check:
name: Docs linting and formatting
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'docs') && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up pnpm
uses: pnpm/action-setup@v5
with:
version: 10.33.0
- name: Set up Node 24
uses: actions/setup-node@v6
with:
node-version: 24.x
cache: "pnpm"
cache-dependency-path: docs/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Check formatting
run: pnpm format
- name: Lint
run: pnpm lint

deploy-docs:
name: Deploy to GitHub Pages
needs: [docs_check]
if: github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'docs') && github.event.pull_request.head.repo.full_name == github.repository
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: release-artifacts
- name: Set up pnpm
uses: pnpm/action-setup@v5
with:
version: 10.33.0
- name: Set up Node 24
uses: actions/setup-node@v6
with:
node-version: 24.x
cache: "pnpm"
cache-dependency-path: docs/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: docs/dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release Amicons update

on:
pull_request:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:

docs_check:
name: Docs linting and formatting
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.repo.full_name == github.repository && (contains(github.event.pull_request.labels.*.name, 'release') || contains(github.event.pull_request.labels.*.name, 'docs'))
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'release') && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
release:
name: Release Amicons stable
needs: [build, docs_check]
if: github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.repo.full_name == github.repository && contains(github.event.pull_request.labels.*.name, 'release')
if: github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'release') && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Download artifacts
Expand Down Expand Up @@ -119,8 +119,8 @@ jobs:

deploy-docs:
name: Deploy to GitHub Pages
needs: [docs_check, release]
if: always() && github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.repo.full_name == github.repository && ((contains(github.event.pull_request.labels.*.name, 'release') && needs.docs_check.result == 'success' && needs.release.result == 'success') || (!contains(github.event.pull_request.labels.*.name, 'release') && contains(github.event.pull_request.labels.*.name, 'docs') && needs.docs_check.result == 'success'))
needs: [release, docs_check]
if: github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'release') && github.event.pull_request.head.repo.full_name == github.repository
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand All @@ -131,6 +131,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: release-artifacts
- name: Set up pnpm
uses: pnpm/action-setup@v5
with:
Expand Down
Loading