feat: add action to generate readme.md from data.js

Closes #155
This commit is contained in:
Andrew Luca 2020-01-09 19:08:21 +02:00
parent a4635718d2
commit 5f2dc8ad7a
No known key found for this signature in database
GPG key ID: ACB54C50A4E2BBE9
4 changed files with 80 additions and 0 deletions

35
.github/workflows/populate-readme.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: Populate README.md from master
on:
push:
branches: website
paths: src/data.js
env:
CI: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 13.x
- name: Populate README.md from master
run: |
node ./scripts/populate-readme.js
git add generated-readme.md
git stash -- generated-readme.md
git checkout master
git stash pop
git reset
mv generated-readme.md readme.md
git add readme.md
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "chore: generate \`readme.md\`"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -3,6 +3,7 @@
"description": "What do you uses",
"version": "7.7.7",
"author": "Wes Bos",
"type": "module",
"eslintConfig": {
"extends": [
"wesbos"

View file

@ -0,0 +1,13 @@
import fs from 'fs';
import data from '../src/data.js';
/** @type {string} */
const readmeTemplate = fs.readFileSync('./scripts/readme-template.md', 'utf8');
const formatedData = data
.map(page => `* [${page.name}](${page.url}) — ${page.description}`)
.join('\r\n');
fs.writeFileSync(
'generated-readme.md',
readmeTemplate.replace('###DATA_PLACEHOLDER###', formatedData)
);

View file

@ -0,0 +1,31 @@
A site for this repo is currently being build. Please check out the [website](https://github.com/wesbos/awesome-uses/tree/website) branch and add yourself in there!
```
▄████████ ▄█ █▄ ▄████████ ▄████████ ▄██████▄ ▄▄▄▄███▄▄▄▄ ▄████████
███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄██▀▀▀███▀▀▀██▄ ███ ███
███ ███ ███ ███ ███ █▀ ███ █▀ ███ ███ ███ ███ ███ ███ █▀
███ ███ ███ ███ ▄███▄▄▄ ███ ███ ███ ███ ███ ███ ▄███▄▄▄
▀███████████ ███ ███ ▀▀███▀▀▀ ▀███████████ ███ ███ ███ ███ ███ ▀▀███▀▀▀
███ ███ ███ ███ ███ █▄ ███ ███ ███ ███ ███ ███ ███ █▄
███ ███ ███ ▄█▄ ███ ███ ███ ▄█ ███ ███ ███ ███ ███ ███ ███ ███
███ █▀ ▀███▀███▀ ██████████ ▄████████▀ ▀██████▀ ▀█ ███ █▀ ██████████
███ █▄ ▄████████ ▄████████ ▄████████
███ ███ ███ ███ ███ ███ ███ ███
███ ███ ███ █▀ ███ █▀ ███ █▀
███ ███ ███ ▄███▄▄▄ ███
███ ███ ▀███████████ ▀▀███▀▀▀ ▀███████████
███ ███ ███ ███ █▄ ███
███ ███ ▄█ ███ ███ ███ ▄█ ███
████████▀ ▄████████▀ ██████████ ▄████████▀
```
# Awesome Uses ![Awesome][awesome-badge]
A list of /uses pages that detail apps and gear used by professional web developers.
Submit your own. URL must be /uses. Link your name along with a few words that describes what you do.
###DATA_PLACEHOLDER###
[awesome-badge]: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg