Skip to content

Commit

Permalink
perf: use GitHub Action to build the document
Browse files Browse the repository at this point in the history
also:

- typo: rename the folder `dist` to `icon`
- chore: remove README and built badges in the code
  • Loading branch information
aleen42 committed Jan 30, 2024
1 parent 259d567 commit ef6e3d1
Show file tree
Hide file tree
Showing 713 changed files with 47 additions and 10,346 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build badges
on:
push:
branches:
- main
concurrency: building
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-node@v2-beta
with:
node-version: '16'
- name: Build
run: |
npm version
npm i --no-save --no-audit
npm link
badge -v
mkdir dist
npm run build
env:
ACCESS_TOKEN: ${{secrets.ACCESS_TOKEN}}
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
single-commit: true
branch: docs
folder: .
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,11 @@ node_modules
# Editor
.idea

# Output Assets
dist
README.md
README_dfc.md
README_flat_square.md
README_flat_square_dfc.md

package-lock.json
258 changes: 0 additions & 258 deletions README.md

This file was deleted.

258 changes: 0 additions & 258 deletions README_dfc.md

This file was deleted.

258 changes: 0 additions & 258 deletions README_flat_square.md

This file was deleted.

258 changes: 0 additions & 258 deletions README_flat_square_dfc.md

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions part/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<br />
<br />

![npm](./src/npm.svg) ![cli](./src/cli.svg) ![javascript](https://img.shields.io/badge/%20%20JavaScript-%20%20%20%20730L-f1e05a.svg) ![html](https://img.shields.io/badge/%20%20HTML-%20%20%20%20164L-e34c26.svg)
![npm](dist/npm.svg) ![cli](dist/cli.svg) ![javascript](https://img.shields.io/badge/%20%20JavaScript-%20%20%20%20730L-f1e05a.svg) ![html](https://img.shields.io/badge/%20%20HTML-%20%20%20%20164L-e34c26.svg)

Alternative: [**default**](./README.md)<!-- @IGNORE PREVIOUS: link -->, [**flat-square**](./README_flat_square.md)<!-- @IGNORE PREVIOUS: link -->, [**dynamic-fore-color**](./README_dfc.md)<!-- @IGNORE PREVIOUS: link -->, [**dynamic-fore-color (flat_square)**](./README_flat_square_dfc.md)<!-- @IGNORE PREVIOUS: link -->.

Expand Down Expand Up @@ -64,4 +64,4 @@ As for how to create a badge and add it to the collection? There are some steps
*Note: if you like this project, feel free to buy me a swimming chance:*
[![badges](./src/paypal.svg)](http://paypal.me/aleen42) [![badges](./src/patreon.svg)](https://www.patreon.com/aleen42) [![badges](./src/buymeacoffee.svg)](https://www.buymeacoffee.com/aleen42)
[![badges](dist/paypal.svg)](http://paypal.me/aleen42) [![badges](dist/patreon.svg)](https://www.patreon.com/aleen42) [![badges](dist/buymeacoffee.svg)](https://www.buymeacoffee.com/aleen42)
2 changes: 1 addition & 1 deletion script/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* - Author: aleen42
* - Description: data for building badges
* - Create Time: Apr 20th, 2017
* - Update Time: Nov 10th, 2023
* - Update Time: Jan 30th, 2024
*
*
**********************************************************************/
Expand Down
10 changes: 5 additions & 5 deletions script/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* - Author: aleen42
* - Description: a script for building README.md
* - Create Time: Apr 20th, 2017
* - Update Time: Apr 8th, 2021
* - Update Time: Jan 30th, 2024
*
*
**********************************************************************/
Expand All @@ -42,9 +42,9 @@ const execSync = require('child_process').execSync;
const data = require('./sorted-data');

const rootPath = './';
const distPath = `${rootPath}dist/`;
const outputPath = `${rootPath}src/`;
const linkPath = 'https://badges.aleen42.com/src/';
const inputPath = `${rootPath}icon/`;
const outputPath = `${rootPath}dist/`;
const linkPath = 'https://badges.aleen42.com/dist/';

const suffix = (base, ...suffix) => [base, ...suffix].filter(x => x).join('_');

Expand All @@ -70,7 +70,7 @@ const generateBadge = (style, dfc) => (name, badgeItem, index) => {
`-c "${color}"`,
`-s ${skin || 'dark'}`,
`-t "${text || name}"`,
`-p ${distPath}${fname}`,
`-p ${inputPath}${fname}`,
`--style=${style}`,
`-o ${output}`,
].join(' ')}`, {
Expand Down
22 changes: 0 additions & 22 deletions src/ac_milan.svg
Diff not rendered.
Loading

0 comments on commit ef6e3d1

Please sign in to comment.