name: github-pages on: workflow_run: branches: [main] workflows: [test] types: [completed] jobs: main: if: github.event.workflow_run.conclusion == 'success' permissions: pages: write id-token: write environment: github-pages runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: { node-version: lts/*, cache: yarn } - uses: Homebrew/actions/setup-homebrew@master - id: brew_cache run: echo "::set-output name=dir::$(brew --cache)" - uses: actions/cache@v3 with: path: ${{ steps.brew_cache.outputs.dir }} key: brew-v3 - name: Build assets run: | yarn install yarn build - name: Build book run: | brew bundle mdbook build - uses: actions/upload-pages-artifact@v1 with: path: book - uses: actions/deploy-pages@v2