Skip to content

Commit b98d21c

Browse files
authored
Merge pull request #1 from mansona/docs
add a getting started section to readme
2 parents 844ca5b + d9f4540 commit b98d21c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,41 @@ An action to build an npm package and push its contents to a branch.
66
after the `pack` command. It will not work as expected with any others in the
77
directory.
88

9+
## Getting started
10+
11+
To use this action you can create a new workflow and copy the following into it:
12+
13+
```yaml
14+
# .github/workflows/push-dist.yml
15+
16+
name: Push dist
17+
18+
on:
19+
push:
20+
branches:
21+
- main
22+
- master
23+
24+
jobs:
25+
push-dist:
26+
name: Push dist
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
- run: npm run build # Add whatever you need to build your pacakage here
31+
- uses: kategengler/[email protected]
32+
with:
33+
branch: ${{ github.head_ref || github.ref_name }}-dist
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
```
36+
37+
If you're working with a fork and you want to publish your work for testing you can update the workflow to build on all pushes to all branches:
38+
39+
```yaml
40+
on:
41+
push: {}
42+
```
43+
944
## Inputs
1045
1146
### `token` (required)

0 commit comments

Comments
 (0)