Skip to content

Commit

Permalink
Merge branch 'main' into chore/tweak-dependabot-groups
Browse files Browse the repository at this point in the history
  • Loading branch information
ppvg committed Dec 18, 2024
2 parents a062cea + c331261 commit 821ca6e
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 61 deletions.
20 changes: 4 additions & 16 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,16 @@ inputs:
runs:
using: "composite"
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version-file: ".nvmrc"
registry-url: ${{ inputs.registry-url }}

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Audit dependencies
shell: bash
run: pnpm audit --audit-level=${{ inputs.audit-level }}
Expand Down
61 changes: 42 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,71 @@ name: CI

on:
push:
branches: [main, 'release/**']
branches: [main, "release/**"]
pull_request:
branches: [main, 'release/**']
branches: [main, "release/**"]

jobs:
audit:
runs-on: ubuntu-latest
name: Audit dependencies
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Audit dependencies
uses: ./.github/actions/setup
with:
audit-level: moderate

lint:
runs-on: ubuntu-latest
name: Lint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Lint SCSS
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Lint
run: pnpm run lint

check-formatting:
runs-on: ubuntu-latest
name: Check formatting
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Check formatting
run: pnpm run format:check

check-docs:
runs-on: ubuntu-latest
name: Check docs
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run svelte-check on docs
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run svelte-check
run: pnpm run --dir docs check

build-docs:
runs-on: ubuntu-latest
name: Build docs
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build docs
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Build
run: pnpm run build
28 changes: 11 additions & 17 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,50 @@
# Simple workflow for deploying documentation to GitHub Pages
name: Deploy docs to Pages
name: Deploy docs

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
name: Build
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
- name: Configure GitHub Pages
uses: actions/configure-pages@v5

- name: Setup
uses: ./.github/actions/setup

- name: Build the documentation
- name: Build
working-directory: docs
env:
BASE_PATH: '/${{ github.event.repository.name }}'
BASE_PATH: "/${{ github.event.repository.name }}"
run: pnpm run build

- name: Copy the documentation
run: mv docs/build _site

- name: Upload artifact
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/

# Deployment job
deploy:
name: Deploy
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build
steps:
- name: Deploy to GitHub Pages
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
name: Publish package to npmjs and GitHub Packages
name: Publish package

on:
push:
tags:
- v*
tags: ["v*"]

jobs:
publish-npm:
runs-on: ubuntu-latest
name: Publish to npm
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
with:
registry-url: "https://registry.npmjs.org"

- name: Get semver from tag
run: |
RELEASE_VERSION=${GITHUB_REF#refs/*/}
Expand All @@ -30,12 +34,17 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-github:
runs-on: ubuntu-latest
name: Publish to GitHub
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
with:
registry-url: "https://npm.pkg.github.com"

- name: Get semver from tag
run: |
RELEASE_VERSION=${GITHUB_REF#refs/*/}
Expand Down

0 comments on commit 821ca6e

Please sign in to comment.