From d9f4540c19c446a1a0d74bf73afcebfb7fd45f5d Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Mon, 29 May 2023 12:23:01 +0100 Subject: [PATCH] add a getting started section to readme --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index 625a194..8cb0794 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,41 @@ An action to build an npm package and push its contents to a branch. after the `pack` command. It will not work as expected with any others in the directory. +## Getting started + +To use this action you can create a new workflow and copy the following into it: + +```yaml +# .github/workflows/push-dist.yml + +name: Push dist + +on: + push: + branches: + - main + - master + +jobs: + push-dist: + name: Push dist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: npm run build # Add whatever you need to build your pacakage here + - uses: kategengler/put-built-npm-package-contents-on-branch@v1.0.0 + with: + branch: ${{ github.head_ref || github.ref_name }}-dist + token: ${{ secrets.GITHUB_TOKEN }} +``` + +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: + +```yaml +on: + push: {} +``` + ## Inputs ### `token` (required)