Automated CHANGELOG.md update #294
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: Push documentation to docs repo | |
on: | |
workflow_dispatch: | |
push: | |
branches: ['main'] | |
jobs: | |
push-to-docs: | |
runs-on: ubuntu-latest | |
steps: | |
# checkout the sdk and build the docs | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.API_TOKEN_GITHUB }} | |
path: sdk | |
- name: Install sdk dependencies | |
working-directory: ./sdk | |
run: yarn | |
- name: Generate docs | |
working-directory: ./sdk | |
run: yarn docs | |
# checkout nvm-docs and test the build with the new documentation | |
- name: Checkout docs | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.API_TOKEN_GITHUB }} | |
repository: nevermined-io/docs | |
path: docs | |
- name: Copy the sdk docs | |
run: cp -r ./sdk/docs ./docs/docs/nevermined-sdk | |
- name: Test nvm-docs build | |
working-directory: ./docs | |
run: | | |
yarn | |
yarn build | |
# commit the new generated docs to the sdk repo | |
- name: Commit sdk docs | |
working-directory: ./sdk | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Nevermined BOT" | |
git add ./docs | |
git commit -m "docs: updating documentation [skip actions]" | |
git push | |
# push to docs repo | |
- name: Install envsubst | |
run: | | |
sudo apt update | |
sudo apt install -y gettext | |
- name: Download push-to-docs script template | |
run: | | |
curl -o push-to-docs.sh.template https://raw.githubusercontent.com/nevermined-io/reusable-workflows/main/scripts/push-to-docs.sh | |
- name: Replace env vars in push-to-docs script | |
env: | |
BRANCH_TO_CLONE: main | |
REPO_TO_PUSH: docs | |
PATH_TO_COPY: ./sdk/docs/ | |
PATH_TO_PUSH: docs/nevermined-sdk | |
REPOSITORY_NAME: ${{ github.repository }} | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
run: | | |
export REPOSITORY_NAME=$(echo $REPOSITORY_NAME | awk -F '/' '{print $2}') | |
envsubst < push-to-docs.sh.template > push-to-docs.sh | |
env > env.file | |
chmod +x push-to-docs.sh | |
./push-to-docs.sh |