In-range update of npm dependencies #954
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: Build and Deploy Docs | |
on: | |
push: | |
branches: | |
- v3 | |
jobs: | |
build-and-deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
env: | |
MIKE_VERSION: v3 | |
DOCKER_IMAGE: ui5-tooling/mkdocs-material | |
GIT_COMMITTER_NAME: "OpenUI5 Bot" | |
GIT_COMMITTER_EMAIL: "openui5@sap.com" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js LTS 18.x | |
uses: actions/setup-node@v4.0.1 | |
with: | |
node-version: 18.x | |
- name: Install npm dependencies | |
run: npm ci | |
- name: Fetch gh-pages branch | |
run: git fetch origin gh-pages --depth=1 | |
- name: Set /site ownership to current user | |
run: | | |
mkdir site | |
sudo chown -R $(id -u):$(id -g) ./site | |
- name: Build docs with Mike | |
run: ./scripts/buildDocs.sh | |
- name: Publish docs | |
run: docker run --rm -v $(pwd):/docs --entrypoint mike --env GIT_COMMITTER_NAME="${GIT_COMMITTER_NAME}" --env GIT_COMMITTER_EMAIL="${GIT_COMMITTER_EMAIL}" $DOCKER_IMAGE set-default stable --push | |
- name: Checkout gh-pages | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Copy the additional resources to gh-pages | |
run: | | |
rm -rf ./gh-pages/$MIKE_VERSION/api | |
cp -R ./site/api ./gh-pages/$MIKE_VERSION/ | |
- name: Publish Docs | |
run: | | |
cd ./gh-pages | |
git config --local user.email $GIT_COMMITTER_EMAIL | |
git config --local user.name $GIT_COMMITTER_NAME | |
git add . | |
git commit -m "Updating supplemental resources for ${MIKE_VERSION} documentation deployment" | |
git push |