Skip to content

deploy_website

deploy_website #38

Workflow file for this run

name: Trigger API reference docs rebuild
on:
workflow_dispatch:
repository_dispatch:
types: [deploy_website]
jobs:
docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{secrets.GH_TOKEN}}
- uses: pnpm/action-setup@v2
with:
version: 7
- name: 'setup node with cache'
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- run: pnpm add -g pnpm
- name: 'build veramo API docs'
run: |
pnpm install
rm -fR ./docs/api
pnpm run build:veramo
- name: 'Docusaurus build'
run: |
pnpm run build
pnpm run format --check
- name: 'setup git coordinates'
run: |
git config --local user.name ${{ secrets.GH_USER }}
git config --local user.email ${{ secrets.GH_EMAIL }}
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/$GITHUB_REPOSITORY
- name: 'Commit changes and tag the new version'
run: |
git clone -b main https://github.com/uport-project/veramo.git veramo
RELEASE_VERSION=`echo "console.log(require('./veramo/lerna.json').version)" | node`
if [ "${GITHUB_REF}" != "refs/heads/main" ]; then
RELEASE_VERSION="${RELEASE_VERSION}-preview-${GITHUB_SHA}"
fi
yarn version --no-git-tag-version --new-version "$RELEASE_VERSION"
git status
echo Deploying docs for version v$RELEASE_VERSION
git add .
git commit -m "chore(release): :rocket: api docs v${RELEASE_VERSION}"
git tag -f -a v$RELEASE_VERSION -m "v${RELEASE_VERSION}"
- name: 'Push the new API reference docs'
run: |
git push origin $GITHUB_REF --tags