Skip to content

Merge pull request #108 from easyops-cn/renovate/easyops-cn-docusauru… #548

Merge pull request #108 from easyops-cn/renovate/easyops-cn-docusauru…

Merge pull request #108 from easyops-cn/renovate/easyops-cn-docusauru… #548

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build_docs:
name: Build docs
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v7
with:
name: brick-artifacts
path: ci-bricks
github_token: ${{ secrets.GITHUB_TOKEN }}
repo: easyops-cn/next-bricks
branch: master
event: push
workflow: ci.yml
workflow_conclusion: ""
- name: Download artifact from next-advanced-bricks
id: download-artifact-from-next-advanced-bricks
uses: dawidd6/action-download-artifact@v7
with:
name: brick-artifacts
path: ci-advanced-bricks
github_token: ${{ secrets.GITHUB_TOKEN }}
repo: easyops-cn/next-advanced-bricks
branch: master
event: push
workflow: ci.yml
workflow_conclusion: ""
- name: Merge bricks
run: cp -r ci-advanced-bricks/* ci-bricks/bricks/
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: yarn
# Fix `yarn install --frozen-lockfile` not working in monorepo.
# https://github.com/yarnpkg/yarn/issues/5840#issuecomment-468782288
- name: Get checksum before yarn install
id: yarn-lock-check-before
run: echo "::set-output name=sum::$(cksum yarn.lock)"
- run: yarn install --frozen-lockfile
- name: Get checksum after yarn install
id: yarn-lock-check-after
run: echo "::set-output name=sum::$(cksum yarn.lock)"
- name: Exit if yarn.lock updated
run: exit 1
if: steps.yarn-lock-check-before.outputs.sum != steps.yarn-lock-check-after.outputs.sum
- run: yarn build
- name: Deploy to Netlify (pull request)
id: netlify-deploy
uses: nwtgck/[email protected]
with:
publish-dir: './build'
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "${{ github.event.pull_request.title }}"
alias: docs-preview-alt-${{ github.event.number }}
netlify-config-path: ./ci-bricks/netlify.toml
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 2
if: github.event_name == 'pull_request'
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.GH_TOKEN_EVE }}
external_repository: easyops-cn/bricks
cname: bricks.js.org
publish_dir: ./build
publish_branch: gh-pages
force_orphan: true
if: github.event_name == 'push'