Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit c9aedce

Browse files
committed
Add NPM package publish workflow
1 parent bd046e6 commit c9aedce

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

.github/workflows/ci.yml renamed to .github/workflows/release.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
name: ci
1+
name: Release
22

33
on:
4-
push:
5-
branches:
6-
- 'master'
4+
release:
5+
types: [created]
76

87
jobs:
98
docker:
@@ -37,3 +36,16 @@ jobs:
3736
with:
3837
username: mattwebbio
3938
password: ${{ secrets.DOCKERHUB_TOKEN }}
39+
npm:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v3
43+
- uses: actions/setup-node@v3
44+
with:
45+
node-version: '18.x'
46+
- run: yarn
47+
- run: tsc
48+
- run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
49+
- run: yarn publish --registry https://npm.pkg.github.com
50+
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
51+
- run: yarn publish --registry https://registry.npmjs.org

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ however, will restart your secondary Pi-hole's DNS server any time a sync is per
1212
backup.
1313

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

@@ -31,6 +32,12 @@ services:
3132
INTERVAL_MINUTES: 30
3233
```
3334
35+
### Node
36+
```shell
37+
npm install -g pihole-sync
38+
pihole-sync
39+
```
40+
3441
## Requirements
3542
The only currently supported way to run this project is with Docker. In theory, you could clone the repo and run it with
3643
Node.

package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22
"name": "pihole-sync",
33
"version": "0.0.1",
44
"type": "module",
5-
"main": "index.js",
5+
"main": "dist/index.js",
66
"license": "MIT",
7+
"scripts": {
8+
"postversion": "git push && git push --tags"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/mattwebbio/pihole-sync.git"
13+
},
714
"devDependencies": {
815
"@tsconfig/node18-strictest-esm": "^1.0.1",
916
"@types/luxon": "^3.0.0",

0 commit comments

Comments
 (0)