Publish #979
This file contains hidden or 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: Publish | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| concurrency: publish | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Set Yarn version | |
| run: corepack prepare [email protected] --activate | |
| - name: Get Yarn cache directory | |
| id: yarn-cache | |
| run: | | |
| echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
| - name: Setup Yarn cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.yarn-cache.outputs.dir }} | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Setup docusaurus cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ".docusaurus" | |
| key: ${{ runner.os }}-docusaurus-${{ hashFiles('**/docusaurus.config.js') }} | |
| restore-keys: | | |
| ${{ runner.os }}-docusaurus- | |
| - name: Setup node_modules cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules/.cache | |
| .yarn/cache | |
| key: ${{ runner.os }}-node_modules-cache-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node_modules-cache- | |
| - name: Clone TS Library (Fetch Latest API Docs) | |
| run: | | |
| git clone --depth 1 https://github.com/WhiskeySockets/Baileys.git temp_library | |
| rm -rf docs/api | |
| cd temp_library && yarn install | |
| yarn build:docs | |
| cd ../ | |
| mv temp_library/docs/api ./docs/api | |
| rm -rf temp_library | |
| - name: Install Dependencies | |
| run: yarn install --immutable | |
| - name: Build Page | |
| run: yarn build | |
| - name: Deploy Page | |
| uses: peaceiris/actions-gh-pages@v4 | |
| continue-on-error: true | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| cname: baileys.wiki | |
| publish_dir: ./build |