Skip to content

Commit

Permalink
Add NPM package publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwebbio committed Aug 26, 2022
1 parent bd046e6 commit c9aedce
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/ci.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: ci
name: Release

on:
push:
branches:
- 'master'
release:
types: [created]

jobs:
docker:
Expand Down Expand Up @@ -37,3 +36,16 @@ jobs:
with:
username: mattwebbio
password: ${{ secrets.DOCKERHUB_TOKEN }}
npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: yarn
- run: tsc
- run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
- run: yarn publish --registry https://npm.pkg.github.com
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- run: yarn publish --registry https://registry.npmjs.org
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ however, will restart your secondary Pi-hole's DNS server any time a sync is per
backup.

## Getting Started
### Docker
The following is an example Docker Compose file for running this project. See the
[environment variables](#environment-variables) section for more configuration options.

Expand All @@ -31,6 +32,12 @@ services:
INTERVAL_MINUTES: 30
```

### Node
```shell
npm install -g pihole-sync
pihole-sync
```

## Requirements
The only currently supported way to run this project is with Docker. In theory, you could clone the repo and run it with
Node.
Expand Down
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
"name": "pihole-sync",
"version": "0.0.1",
"type": "module",
"main": "index.js",
"main": "dist/index.js",
"license": "MIT",
"scripts": {
"postversion": "git push && git push --tags"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mattwebbio/pihole-sync.git"
},
"devDependencies": {
"@tsconfig/node18-strictest-esm": "^1.0.1",
"@types/luxon": "^3.0.0",
Expand Down

0 comments on commit c9aedce

Please sign in to comment.