Skip to content

Commit

Permalink
Merge pull request #10 from planningcenter/ns/nccworkflow2
Browse files Browse the repository at this point in the history
Add reusable NCC workflow
  • Loading branch information
sheck authored Nov 7, 2022
2 parents 3f6f460 + fe17a46 commit d0bfae3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 15 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/internal-ncc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: ncc

on:
push:
branches:
- '**'
paths:
- 'ncc/package-lock.json'
- 'ncc/src/**'

defaults:
run:
working-directory: ncc

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm ci
- uses: planningcenter/balto-utils/ncc@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
root-directory: ncc
17 changes: 3 additions & 14 deletions .github/workflows/ncc.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
name: ncc

on:
push:
branches:
- '**'
paths:
- 'ncc/package-lock.json'
- 'ncc/src/**'

defaults:
run:
working-directory: ncc
on: workflow_call

jobs:
build:
ncc-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm ci
- uses: planningcenter/balto-utils/ncc@main
- uses: planningcenter/balto-utils/ncc@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
root-directory: ncc
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,28 @@ Utilities, composite actions, and reusable workflows for our GitHub actions
Automatically compiles and commits built files with ncc if build files were not
updated.

### Sample config
### Simple config (requires using npm)

```yml
name: ncc
on:
push:
# Can't push a build commit to a tag, so only run for branches
branches:
- '**'
paths:
# Include any files that could require rebuilding
- 'package-lock.json'
- 'src/**'

jobs:
ncc-build:
uses: planningcenter/balto-utils/.github/workflows/ncc.yml@v1
```
<details>
<summary>
<h3>Advanced config</h3>
</summary>
```yml
name: ncc
Expand All @@ -36,6 +57,7 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
```
</details>
## yarn
Expand Down

0 comments on commit d0bfae3

Please sign in to comment.