Skip to content

Commit

Permalink
Switch out NPM for PNPM
Browse files Browse the repository at this point in the history
  • Loading branch information
Soitora committed Oct 22, 2023
1 parent ea258ac commit e4e1c20
Show file tree
Hide file tree
Showing 6 changed files with 3,883 additions and 12,591 deletions.
104 changes: 64 additions & 40 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,69 @@
name: CI/CD

on:
push:
branches:
- main
push:
branches:
- main

jobs:
compile-and-publish:
name: Compile and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install dependencies
run: |
npm ci
- name: Clean files
run: |
npm run clean
- name: Convert Stylus to CSS
run: |
npm run stylus
- name: Compile files
run: |
npm run compile-single
- name: Deploy files
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
clean-exclude: |
assets
images
LICENSE
favicon.ico
index.html
commit-message: ${{ github.event.head_commit.message }} @ ${{ github.sha }} 🚀
compile-and-publish:
name: Compile and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
with:
token: ${{ secrets.ACCESS_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
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: Install dependencies
run: pnpm install

- name: Clean files
run: |
pnpm clean
- name: Convert Stylus to CSS
run: |
pnpm stylus
- name: Compile files
run: |
pnpm compile-single
- name: Deploy files
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
clean-exclude: |
assets
images
LICENSE
favicon.ico
index.html
commit-message: ${{ github.event.head_commit.message }} @ ${{ github.sha }} 🚀
47 changes: 29 additions & 18 deletions .github/workflows/validation.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
name: Validation

on:
pull_request:
branches:
- main
pull_request:
branches:
- main

jobs:
validation:
name: Validate build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: |
npm ci
- name: Compile files
run: |
npm run compile
validation:
name: Validate build
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
with:
token: ${{ secrets.ACCESS_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Install dependencies
run: pnpm install

- name: Compile files
run: |
pnpm compile
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ If you would like to contribute to this repository, please...
1. [![fork](https://user-images.githubusercontent.com/136959/42383736-c4cb0db8-80fd-11e8-91ca-12bae108bccc.png) Fork](https://github.com/Soitora/SweClockers-Dark/fork) the repository then clone it locally.
2. Make sure you have these installed:

- [`node`](https://nodejs.org): version 12 or greater
- You will need [Node.js](http://nodejs.org) **version 16+**, and [pnpm](https://pnpm.io/installation) **version 8+**.

3. Run `npm install` to install the necessary node packages.
3. Run `pnpm i` to install the necessary node packages.

4. Make sure your IDE or text editor such as Visual Studio Code / Notepad++ supports reading `.editorconfig`.

Expand All @@ -22,11 +22,11 @@ If you would like to contribute to this repository, please...
This project uses [`browser-sync`](https://www.npmjs.com/package/browser-sync) to inject the generated `.css` file into your browser.

#### Editing using a single script (Recommended)
You can get up and running by simply executing the command `npm run local`.
You can get up and running by simply executing the command `pnpm local`.

This uses gulp to start the browser sync and in the same script also watch and generate changes done to `src/sweclockers-dark.styl`.

#### Generate and run server seperately
To generate `dist/sweclockers-dark.css` file once, run `npm run stylus`, if you want it to generate the file every time changes occur to `src/sweclockers-dark.styl`, run `npm run stylus-watch`.
To generate `dist/sweclockers-dark.css` file once, run `pnpm stylus`, if you want it to generate the file every time changes occur to `src/sweclockers-dark.styl`, run `pnpm stylus-watch`.

You can run the `browser-sync` script with `npm run browser-sync` and it will inject the `dist/sweclockers-dark.css` file onto a proxied version of `https://www.sweclockers.com/` .
You can run the `browser-sync` script with `pnpm browser-sync` and it will inject the `dist/sweclockers-dark.css` file onto a proxied version of `https://www.sweclockers.com/` .
Loading

0 comments on commit e4e1c20

Please sign in to comment.