Skip to content

ci: update test command to use npm test:ci for CI environments #45

ci: update test command to use npm test:ci for CI environments

ci: update test command to use npm test:ci for CI environments #45

Workflow file for this run

name: Create Release and Publish to npm
on:
push:
branches:
- main
jobs:
release:
name: Create Release and Publish to npm
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Test
run: npm test:ci
- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
# Additional steps to build and publish the documentation
- name: Build documentation
run: npm run docs:build # Ensure this command correctly generates the static files
- name: Checkout documentation repo
uses: actions/checkout@v3
with:
repository: holy-sheets/holy-sheets.github.io
token: ${{ secrets.DOCS_GH_TOKEN }}
path: docs-site # Directory where the repository will be cloned
- name: Copy generated docs to docs repo
run: |
rm -rf docs-site/* # Remove old files
cp -R docs/.vitepress/dist/* docs-site/ # Adjust the path according to your build structure
- name: Commit and Push changes
run: |
cd docs-site
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "docs: update site from main repo" || echo "No changes to commit"
git push origin main # Push to the main branch
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}