Skip to content

Commit

Permalink
switch to gh pages
Browse files Browse the repository at this point in the history
  • Loading branch information
nichoth committed Oct 17, 2024
1 parent 7a0dd39 commit e99aa52
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 3 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: GitHub Pages deploy

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 only one concurrent deployment, skipping runs queued between the run
# in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production
# deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Install
run: npm install
- name: Build
run: npm run build-example
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: public/

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dist
example/node_modules
example/100-*.jpg
package-lock.json
example/public
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@
![tests](https://github.com/bicycle-codes/image/actions/workflows/nodejs.yml/badge.svg)
[![types](https://img.shields.io/npm/types/@bicycle-codes/image)](README.md)
[![module](https://img.shields.io/badge/module-ESM%2FCJS-blue)](README.md)
[![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
[![Common Changelog](https://nichoth.github.io/badge/common-changelog.svg)](./CHANGELOG.md)
[![install size](https://packagephobia.com/badge?p=@bicycle-codes/image)](https://packagephobia.com/result?p=@bicycle-codes/image)
[![license](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)

Create responsive image tags.

<details><summary><h2>Contents</h2></summary>
<!-- toc -->
</details>

## install
```

```sh
npm i -S @bicycle-codes/image
```

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"scripts": {
"start": "npm run build && ./bin/resize.js ./example/100.jpg -o ./example && cd example && rm -rf ./node_modules && npm i && npm start",
"build-example": "npm run build && ./bin/resize.js ./example/100.jpg -o ./example && cd example && rm -rf ./node_modules && npm i && npx vite build && cp ./100* ./dist",
"build-example": "npm run build && ./bin/resize.js ./example/100.jpg -o ./example && cd example && rm -rf ./node_modules && npm ci && VITE_DEBUG_MODE=staging vite build --mode staging --base=\"/image\" && mkdir -p ./public && cp ./100* ./public",
"lint": "eslint \"./**/*.{ts,js}\"",
"test": "npm run lint && node test/cli.js | tap-spec && npm run test-html",
"test-html": "npm run lint && node test/index.js | tap-spec",
Expand All @@ -19,8 +19,9 @@
"build": "mkdir -p ./dist && rm -rf ./dist/* && npm run build-cjs && tsc --project tsconfig.build.json && npm run cp-css && npm run build-tonic && npm run build-bin",
"build-tonic": "cp ./src/cloudinary/tonic.js ./dist/cloudinary && cp ./src/tonic.js ./dist",
"cp-css": "cp ./src/*.css ./dist",
"toc": "markdown-toc --maxdepth 3 -i README.md",
"preversion": "npm run lint",
"version": "auto-changelog -p --template keepachangelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md",
"version": "npm run toc && auto-changelog -p --template keepachangelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md README.md",
"postversion": "git push && git push --tags && npm publish",
"prepublishOnly": "npm run build"
},
Expand All @@ -47,6 +48,7 @@
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
"htm": "^3.1.1",
"markdown-toc": "^1.2.0",
"postcss-import": "^16.1.0",
"postcss-nesting": "^13.0.0",
"tap-spec": "^5.0.0",
Expand Down

0 comments on commit e99aa52

Please sign in to comment.