Browse Source

chore(action): run action only for certain paths

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/843/head
Pranav C 3 years ago
parent
commit
1fc7ffdf0f
  1. 8
      .github/workflows/publish-blog.yml
  2. 8
      .github/workflows/publish-book.yml
  3. 9
      .github/workflows/publish-docs.yml
  4. 8
      .github/workflows/publish-noco-i18n.yml

8
.github/workflows/publish-blog.yml

@ -3,6 +3,8 @@ name: "Publish : Blog"
on: on:
push: push:
branches: [ master ] branches: [ master ]
paths:
- "packages/noco-blog/**"
jobs: jobs:
copy-file: copy-file:
@ -12,16 +14,11 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Check for update
run: |
echo "CHANGED=$([[ $(lerna ls --since ${{github.event.before}} | grep noco-blog) = noco-blog ]] && echo 'OK')" >> $GITHUB_ENV
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
if: ${{ env.CHANGED == 'OK' }}
with: with:
node-version: 14 node-version: 14
- name: Build blogs - name: Build blogs
if: ${{ env.CHANGED == 'OK' }}
run: | run: |
cd packages/noco-blog cd packages/noco-blog
npm install npm install
@ -29,7 +26,6 @@ jobs:
- name: Pushes generated output - name: Pushes generated output
if: ${{ env.CHANGED == 'OK' }}
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658 uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env: env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }} API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}

8
.github/workflows/publish-book.yml

@ -3,6 +3,8 @@ name: "Publish : Book"
on: on:
push: push:
branches: [ master ] branches: [ master ]
paths:
- "packages/noco-book/**"
jobs: jobs:
copy-file: copy-file:
@ -12,16 +14,11 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Check for update
run: |
echo "CHANGED=$([[ $(lerna ls --since ${{github.event.before}} | grep noco-book) = noco-book ]] && echo 'OK')" >> $GITHUB_ENV
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
if: ${{ env.CHANGED == 'OK' }}
with: with:
node-version: 14 node-version: 14
- name: Build book - name: Build book
if: ${{ env.CHANGED == 'OK' }}
run: | run: |
cd packages/noco-book cd packages/noco-book
npm install npm install
@ -29,7 +26,6 @@ jobs:
- name: Pushes generated output - name: Pushes generated output
if: ${{ env.CHANGED == 'OK' }}
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658 uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env: env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }} API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}

9
.github/workflows/publish-docs.yml

@ -3,6 +3,8 @@ name: "Publish : Docs"
on: on:
push: push:
branches: [ master ] branches: [ master ]
paths:
- "packages/noco-docs/**"
release: release:
types: [ published ] types: [ published ]
@ -14,16 +16,10 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Check for update
run: |
echo "CHANGED=$([[ $(lerna ls --since ${{github.event.before}} | grep noco-docs) = noco-docs ]] && echo 'OK')" >> $GITHUB_ENV
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
if: ${{ env.CHANGED == 'OK' || github.event_name == 'release' }}
with: with:
node-version: 14 node-version: 14
- name: Build docs - name: Build docs
if: ${{ env.CHANGED == 'OK' || github.event_name == 'release' }}
run: | run: |
cd packages/noco-docs cd packages/noco-docs
npm install npm install
@ -31,7 +27,6 @@ jobs:
- name: Pushes generated output - name: Pushes generated output
if: ${{ env.CHANGED == 'OK' || github.event_name == 'release' }}
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658 uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env: env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }} API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}

8
.github/workflows/publish-noco-i18n.yml

@ -3,6 +3,8 @@ name: "Publish : noco-i18n"
on: on:
push: push:
branches: [ master ] branches: [ master ]
paths:
- "packages/noco-i18n/**"
release: release:
types: [ published ] types: [ published ]
@ -14,16 +16,11 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Check for update
run: |
echo "CHANGED=$([[ $(lerna ls --since ${{github.event.before}} | grep noco-i18n) = noco-i18n ]] && echo 'OK')" >> $GITHUB_ENV
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
if: ${{ env.CHANGED == 'OK' }}
with: with:
node-version: 14 node-version: 14
- name: Build noco-i18n - name: Build noco-i18n
if: ${{ env.CHANGED == 'OK' || github.event_name == 'release' }}
run: | run: |
cd packages/noco-i18n cd packages/noco-i18n
npm install npm install
@ -31,7 +28,6 @@ jobs:
- name: Pushes generated output - name: Pushes generated output
if: ${{ env.CHANGED == 'OK' || github.event_name == 'release' }}
# uses: dmnemec/copy_file_to_another_repo_action@main # uses: dmnemec/copy_file_to_another_repo_action@main
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658 uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env: env:

Loading…
Cancel
Save