Skip to content

Commit

Permalink
publish on github
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Nov 24, 2023
1 parent 9136378 commit 4a373b5
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 7,660 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Deploy
on:
push:
tags:
- v*
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: deploy
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Use Node.js 😂
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install and Build 🔧
run: |
npm ci
npm run build-ci
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: .

- name: Publish to NPM 📖
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout 🍔🍟🥤
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Use Node.js 😂
uses: actions/setup-node@v3
with:
node-version: 18

- name: Test 🧪
run: |
npm ci
npm run check-ci
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# -- clip-for-deploy-start --

/docs
/dist

# -- clip-for-deploy-end --

*.pyc
.DS_Store
node_modules
Expand Down
9 changes: 9 additions & 0 deletions build/prep-for-deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import fs from 'fs';
import path from 'path';
import * as url from 'url';
const dirname = url.fileURLToPath(new URL('.', import.meta.url));

const ignoreFilename = path.join(dirname, '..', '..', '.gitignore');
const ignore = fs.readFileSync(ignoreFilename, {encoding: 'utf8'});
const newIgnore = ignore.replace(/# -- clip-for-deploy-start --[\s\S]*?# -- clip-for-deploy-end --/, '');
fs.writeFileSync(ignoreFilename, newIgnore);
Loading

0 comments on commit 4a373b5

Please sign in to comment.