Skip to content

docs: update install instructions and manifest update details #54

docs: update install instructions and manifest update details

docs: update install instructions and manifest update details #54

name: Sync docs to docs site repo
on:
push:
branches:
- main
paths:
- "docs/**"
pull_request:
branches:
- main
paths:
- "docs/**"
workflow_dispatch:
jobs:
config-sync:
name: Sync docs to docs site repo
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Generate a GitHub token
id: ghtoken
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
with:
app-id: ${{ secrets.GH_APP_ID_DOCS }}
owner: slackapi
private-key: ${{ secrets.GH_APP_PRIVATE_KEY_DOCS }}
- name: Checkout the tool repo (source)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Checkout the docs site repo (destination)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: slackapi/slackapi.github.io
path: "docs_repo"
token: ${{ steps.ghtoken.outputs.token }}
persist-credentials: false
- name: Update docs in docs site repo
run: |
rsync -av --delete ./docs/ "./docs_repo/content/$REPO/"
env:
REPO: ${{ github.event.repository.name }}
- name: Install dependencies
run: |
cd docs_repo
npm ci
- name: Build Docusaurus site
run: |
cd docs_repo
npm run build
- name: Create a pull request
if: ${{ github.ref_name == github.event.repository.default_branch || github.event_name == 'workflow_dispatch' }}
id: site-pr
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ steps.ghtoken.outputs.token }}
title: "From ${{ github.event.repository.name }}: ${{ github.event.pull_request.title || 'manual docs sync' }}"
body: "${{ github.event.pull_request.body }}"
author: "slackapi[bot] <186980925+slackapi[bot]@users.noreply.github.com>"
committer: "slackapi[bot] <186980925+slackapi[bot]@users.noreply.github.com>"
commit-message: "Sync docs from ${{ github.event.repository.name }} to docs site repo"
base: "main"
branch: "docs-sync-${{ github.event.repository.name }}-${{ github.sha }}"
labels: docs
path: "./docs_repo"
- name: Output the pull request link
if: ${{ steps.site-pr.outputs.pull-request-url }}
run: |
echo "Pull request created: $URL" >> $GITHUB_STEP_SUMMARY
env:
URL: ${{ steps.site-pr.outputs.pull-request-url }}