diff --git a/.github/workflows/internal-ncc.yml b/.github/workflows/internal-ncc.yml new file mode 100644 index 0000000..d73d8bb --- /dev/null +++ b/.github/workflows/internal-ncc.yml @@ -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 diff --git a/.github/workflows/ncc.yml b/.github/workflows/ncc.yml index d73d8bb..039f1ea 100644 --- a/.github/workflows/ncc.yml +++ b/.github/workflows/ncc.yml @@ -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 diff --git a/README.md b/README.md index 15c4bc6..bc2ecd1 100644 --- a/README.md +++ b/README.md @@ -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 +``` +
+ +

Advanced config

+
```yml name: ncc @@ -36,6 +57,7 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} ``` +
## yarn