Skip to content

Commit

Permalink
Use pnpm instead of npm
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeegan committed May 22, 2024
1 parent de4c5d6 commit b118d6b
Show file tree
Hide file tree
Showing 5 changed files with 2,259 additions and 2,924 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,35 @@ name: Build and deploy to gh-pages
on: push

jobs:
build-and-deploy:
name: Build and deploy
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm install
- run: npm run build
- uses: JamesIves/github-pages-deploy-action@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Deploy to gh-pages
cache: "pnpm"
- run: pnpm install
- run: pnpm run build
- uses: actions/upload-pages-artifact@v3
with:
branch: gh-pages
folder: dist
single-commit: true
path: "dist/"

deploy:
if: github.ref == 'refs/heads/main'
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/deploy-pages@v4
id: deployment
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier
additional_dependencies:
- prettier
- "@prettier/plugin-pug"

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending

- repo: https://github.com/pre-commit/mirrors-eslint
rev: "v8.51.0"
rev: "v9.3.0"
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
Expand Down
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ The data used to generate it can be edited at [ssciwr/research-software-director

Implemented in javascript and SVG using [svg.js](https://svgjs.dev/)

## Online preview
## Deployment

On every commit to the main branch:
On every commit to the main branch, the [deploy.yml](https://github.com/ssciwr/research-software-directory-visualization/actions/workflows/deploy.yml) action builds website & deploys to gh-pages at [ssciwr.github.io/research-software-directory-visualization](https://ssciwr.github.io/research-software-directory-visualization/)

- [deploy.yml](https://github.com/ssciwr/research-software-directory-visualization/actions/workflows/deploy.yml) action builds website & deploys to the [gh-pages](https://github.com/ssciwr/research-software-directory-visualization/tree/gh-pages) branch
- github pages hosts these files at [ssciwr.github.io/research-software-directory-visualization](https://ssciwr.github.io/research-software-directory-visualization/)

## How to build and view locally
## How to build and edit locally

Initial setup:

Expand All @@ -27,14 +24,12 @@ Initial setup:
- (optional) install pre-commit to auto-format code
- `pip install pre-commit`
- `pre-commit install`
- install node
- macOS: `brew install node`
- windows: https://nodejs.org/en/
- ubuntu: `sudo apt install nodejs npm`
- conda: `conda install nodejs -c conda-forge`
- install website node dependencies
- `npm install`
- install [pnpm](https://pnpm.io/installation)
- windows: `iwr https://get.pnpm.io/install.ps1 -useb | iex`
- linux/macOS: `curl -fsSL https://get.pnpm.io/install.sh | sh -`
- install website dependencies
- `pnpm install`

To build from source, start local http-server, open website in browser, monitor & re-build modified source files:

- `npm start`
- `pnpm start`
Loading

0 comments on commit b118d6b

Please sign in to comment.