Skip to content

Commit

Permalink
chore: fix docs pipeline (solana-labs#25504)
Browse files Browse the repository at this point in the history
* chore: change trigger rule

* chore: check tag and file modifed
  • Loading branch information
yihau authored May 24, 2022
1 parent 514f73f commit 79df195
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ on:
branches:
- master
- v[0-9]+.[0-9]+
paths:
- "docs/**"
tags:
- "*"
- v[0-9]+.[0-9]+.[0-9]+
pull_request:
branches:
- master
Expand All @@ -24,9 +22,12 @@ jobs:
fetch-depth: 0

- name: Check
id: check
run: |
source ci/env.sh
ci/channel_restriction.sh edge beta
echo "::set-output name=tag::$CI_TAG"
eval "$(ci/channel-info.sh)"
echo "::set-output name=channel::$CHANNEL"
- name: Get specific changed files
id: changed-files-specific
Expand All @@ -35,14 +36,28 @@ jobs:
files: |
docs/**
- name: Pre Build
id: prebuild
run: |
echo "::set-output name=need_to_build::${{
steps.check.outputs.tag != ''
||
(
(steps.check.outputs.channel == 'edge' || steps.check.outputs.channel == 'beta')
&&
steps.changed-files-specific.outputs.any_change != ''
)
}}"
shell: bash

- name: Setup Node
if: steps.changed-files-specific.outputs.any_changed == 'true'
if: ${{ steps.prebuild.outputs.need_to_build == 'true' }}
uses: actions/setup-node@v3
with:
node-version: 14

- name: Build
if: steps.changed-files-specific.outputs.any_changed == 'true'
if: ${{ steps.prebuild.outputs.need_to_build == 'true' }}
working-directory: docs
run: |
npm install
Expand Down

0 comments on commit 79df195

Please sign in to comment.