fix pipelines #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main CI Workflow | |
on: push | |
env: | |
DOCS_REPO_PATH: docs-repo | |
DOCS_BRANCH_NAME: gh-pages | |
DOCS_LOCAL_PATH: docs | |
jobs: | |
build-test-eslint-node-18: | |
name: Build, Test & Eslint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: yarn install | |
- run: yarn build | |
- run: yarn test | |
- run: yarn eslint | |
- name: checkout docs branch | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ env.GITHUB_REPOSITORY }} | |
token: ${{ secrets.GH_ACCESS_TOKEN }} | |
path: ${{ env.DOCS_REPO_PATH }} | |
ref: ${{ env.DOCS_BRANCH_NAME }} | |
- name: Update Docs | |
env: | |
CR_TOKEN: "${{ secrets.GH_ACCESS_TOKEN }}" | |
run: | | |
# Get repo info from env | |
owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY") | |
repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY") | |
# build docs | |
yarn build-docs | |
# push to github page branch | |
cp --force -u -r ${DOCS_LOCAL_PATH}/* ${DOCS_REPO_PATH}/ | |
rm -Rf ${DOCS_LOCAL_PATH} | |
pushd "${DOCS_REPO_PATH}" > /dev/null | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
git add --all | |
git commit --message="auto update docs" --signoff | |
git push "https://x-access-token:[email protected]/${GITHUB_REPOSITORY}" ${DOCS_BRANCH_NAME} | |
popd > /dev/null | |
build-test-eslint-node-20: | |
name: Build, Test & Eslint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- run: yarn install | |
- run: yarn build | |
- run: yarn test | |
- run: yarn eslint |