solana/.github/workflows/docs.yml

71 lines
1.8 KiB
YAML
Raw Normal View History

name: docs
on:
push:
branches:
- master
- v[0-9]+.[0-9]+
tags:
- v[0-9]+.[0-9]+.[0-9]+
pull_request:
branches:
- master
- v[0-9]+.[0-9]+
jobs:
2022-05-05 23:42:05 -07:00
docs-build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check
id: check
run: |
source ci/env.sh
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
uses: tj-actions/changed-files@v29.0.7
with:
files: |
.github/workflows/docs.yml
docs/**
- name: Pre Build
id: prebuild
run: |
echo "tag: ${{ steps.check.outputs.tag }}"
echo "channel: ${{ steps.check.outputs.channel }}"
echo "any changes: ${{ steps.changed-files-specific.outputs.any_changed }}"
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_changed != ''
)
}}"
shell: bash
- name: Setup Node
if: ${{ steps.prebuild.outputs.need_to_build == 'true' }}
uses: actions/setup-node@v3
with:
node-version: 14
- name: Build
if: ${{ steps.prebuild.outputs.need_to_build == 'true' }}
working-directory: docs
run: |
npm install
./build.sh
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}