3.1.4 (2025-01-24)
3.1.3 (2024-09-04)
- upload-artifact include-hidden-files: true (0e28509)
3.1.2 (2024-04-19)
3.1.1 (2024-01-30)
- return changelog and change release workflow (8921c37)
- PDF generation is supported using docs2pdf
- the upload logic has been removed from this action and moved to docs-upload-action
File: .github/workflow/build.yml
name: Build
on:
pull_request:
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
uses: diplodoc-platform/docs-build-action@v2
with:
revision: "pr-${{ github.event.pull_request.number }}"
project-name: ${{ secrets.DIPLODOC_PROJECT_NAME }}
src-root: "./docs"
storage-bucket: ${{ secrets.DIPLODOC_STORAGE_BUCKET }}
storage-endpoint: ${{ vars.DIPLODOC_STORAGE_ENDPOINT }}
storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }}
storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }}
storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }}
File: .github/workflows/build.yml
Note: Be careful and approve the start of this workflow for PR from forks if there are no suspicious changes
name: Build
on:
pull_request:
paths: 'docs/**'
types: [opened, synchronize]
jobs:
build-docs:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
uses: diplodoc-platform/docs-build-action@v3
with:
revision: "pr-${{ github.event.pull_request.number }}"
src-root: "./docs"
File: .github/workflows/post-build.yml
Note: The configuration with two workflow files allows to run a build for PR from forks. Because .github/workflows/post-build.yml
workflow will have access to the repository secrets.
name: Upload & Message
on:
workflow_run:
workflows: [Build]
types:
- completed
jobs:
post-build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Upload
uses: diplodoc-platform/docs-upload-action@v1
if: github.event.workflow_run.conclusion == 'success'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
storage-endpoint: ${{ vars.DIPLODOC_STORAGE_ENDPOINT }}
storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }}
storage-bucket: ${{ vars.DIPLODOC_STORAGE_BUCKET }}
storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }}
storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }}
- name: Comment message
uses: diplodoc-platform/docs-message-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
project-link: ${{ vars.DIPLODOC_PROJECT_LINK }}