Skip to content

Commit

Permalink
feat: support shared storage bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
yndx-birman committed Aug 15, 2023
1 parent d32453c commit f8edebf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Inputs

- `revision` (required) - The revision or version identifier for the documentation to be built.
- `project-name` (required) - The documentation's project name, as specified in the configuration file's field with the corresponding name.
- `src-root` (required) - The root directory where the source documentation files are located. The action will use this directory as the base location to look for the source files that need to be built.
- `storage-bucket` (required) - The name of the storage bucket where the built documentation will be stored. After the documentation is successfully built, it will be uploaded to this specified bucket.
- `storage-endpoint` (required) - The endpoint URL of the storage service.
Expand All @@ -11,6 +12,7 @@
- `storage-region` (required) - The region where the specified storage bucket is located.
- `lint-root` (default: `./_docs-lint`) - The root directory for the linting process. This is an optional parameter, and if not specified, the default value will be used.
- `build-root` (default: `./_docs-build`) - The root directory for the built documentation. This is an optional parameter, and if not specified, the default value will be used.
- `shared-storage-bucket` (default: `false`) - This argument specifies whether the storage bucket should be shared across multiple projects.

## Example

Expand All @@ -30,6 +32,7 @@ jobs:
uses: diplodoc-platform/docs-build-action@v1
with:
revision: "pr-${{ github.event.pull_request.number }}"
project-name: ${{ secrets.DOCS_PROJECT_NAME }}
src-root: "./docs"
storage-bucket: ${{ secrets.DOCS_AWS_BUCKET }}
storage-endpoint: ${{ vars.DOCS_AWS_ENDPOINT }}
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ description: Build & Upload Docs
inputs:
revision:
required: true
project-name:
required: true
src-root:
required: true
storage-bucket:
Expand All @@ -20,6 +22,8 @@ inputs:
default: "./_docs-lint"
build-root:
default: "./_docs-build"
shared-storage-bucket:
default: false

runs:
using: composite
Expand All @@ -40,7 +44,7 @@ runs:
with:
args: --exact-timestamps
env:
DEST_DIR: "rev/${{ inputs.revision }}"
DEST_DIR: "${{ inputs.shared-storage-bucket == 'true' && inputs.project-name + "/" }}rev/${{ inputs.revision }}"
SOURCE_DIR: "${{ inputs.build-root }}"
AWS_S3_BUCKET: ${{ inputs.storage-bucket }}
AWS_S3_ENDPOINT: ${{ inputs.storage-endpoint }}
Expand Down

0 comments on commit f8edebf

Please sign in to comment.