Files
gitea-docs/.gitea/workflows/build-and-publish.yaml
HesterG 04a97d20b1 Add api page (#32)
# Changes

- Added [redocusaurus](https://github.com/rohit-gohri/redocusaurus) package to display swagger api with reference to [woodpecker](https://github.com/woodpecker-ci/woodpecker/tree/master/docs)
- Change `sed` for swagger.json for proper version and baseurl.
- Add a dropdown for different api versions. (screenshot below)
- On API pages, only API version dropdown will show(hide locale dropdown, version dropdown for doc, and doc search)
- Allow build CSR API pages for development so it saves building time.

# Screenshots

![Screen Shot 2023-06-27 at 11.56.59](/attachments/7f43976d-f9f1-42ff-85f5-0bc84e549441)

![Screen Shot 2023-06-27 at 10.58.11](/attachments/bde25da5-b0a6-4908-9c69-c6aed41f8f59)

![Screen Shot 2023-06-21 at 12.26.26](/attachments/84a9bf5a-229b-4031-9654-3bae6cb3301a)

![Screen Shot 2023-06-19 at 16.34.33](/attachments/653b2b59-bc8a-4e6c-82f2-eb9710f55d8d)

Search:

![Screen Shot 2023-06-21 at 14.49.15](/attachments/3a09bd89-36a8-4156-a2df-2d3176d3ddb1)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/32
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-07-05 03:54:54 +00:00

52 lines
1.5 KiB
YAML

name: Build and Publish Docs site
run-name: docusaurus build docs site
on:
push:
branches:
- main
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: https://github.com/actions/setup-node@v3
with:
node-version: 16
- name: install necessary tools
run: |
apt update -y && apt install -y rsync python python3-pip
pip install awscli
- name: prepare nightly docs
run: |
make prepare-latest
make prepare-latest-zh-cn
- name: prepare 1.20 docs
run: |
make prepare\#20
make prepare-zh-cn\#20
- name: prepare 1.19 docs
run: |
make prepare\#19
make prepare-zh-cn\#19
- name: prepare awesome list
run: |
make prepare-awesome-latest prepare-awesome\#20 prepare-awesome\#19
- name: cleanup before build
run: |
rm static/_*
- name: build site
run: |
make build
- name: aws credential configure
uses: https://github.com/aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws-region: ${{ secrets.AWS_REGION}}
- name: Copy files to the production website with the AWS CLI
run: |
aws s3 sync build/ s3://docs-gitea-com
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION}} --paths '/*'