mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 04:41:35 +08:00
Update aws docs deployment (match current 1.16)
This commit is contained in:
@@ -7,42 +7,50 @@ on:
|
|||||||
- "release/**"
|
- "release/**"
|
||||||
paths:
|
paths:
|
||||||
- "docs/en/**"
|
- "docs/en/**"
|
||||||
|
- "docs/zh/**"
|
||||||
|
- "docs/uk/**"
|
||||||
|
- "docs/ko/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- "**"
|
|
||||||
paths:
|
paths:
|
||||||
- "docs/en/**"
|
- "docs/en/**"
|
||||||
|
- "docs/zh/**"
|
||||||
workflow_dispatch:
|
- "docs/uk/**"
|
||||||
|
- "docs/ko/**"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
actions: read
|
||||||
id-token: write # for AWS OIDC
|
id-token: write # for AWS OIDC
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: docs-deploy
|
group: docs-deploy
|
||||||
cancel-in-progress: false
|
cancel-in-progress: false
|
||||||
|
|
||||||
env:
|
|
||||||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on:
|
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
|
||||||
[
|
outputs:
|
||||||
runs-on,
|
branchname: ${{ steps.set-branch.outputs.branchname }}
|
||||||
runner=8cpu-linux-x64,
|
releaseversion: ${{ steps.set-version.outputs.releaseversion }}
|
||||||
image=ubuntu24-full-x64,
|
|
||||||
"run-id=${{ github.run_id }}",
|
|
||||||
spot=false,
|
|
||||||
extras=s3-cache,
|
|
||||||
]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: runs-on/action@v1
|
- uses: runs-on/action@v1
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- id: set-branch
|
||||||
|
run: echo "branchname=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- id: set-version
|
||||||
|
run: |
|
||||||
|
branch="${{ steps.set-branch.outputs.branchname }}"
|
||||||
|
if [[ "$branch" == "main" ]]; then
|
||||||
|
version="main"
|
||||||
|
else
|
||||||
|
version="v${branch#release/}"
|
||||||
|
fi
|
||||||
|
echo "releaseversion=$version" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@@ -55,6 +63,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Build with VitePress
|
- name: Build with VitePress
|
||||||
working-directory: ./docs
|
working-directory: ./docs
|
||||||
|
env:
|
||||||
|
BRANCH_NAME: ${{ steps.set-version.outputs.releaseversion }}
|
||||||
run: |
|
run: |
|
||||||
npm run docs:build_ubuntu
|
npm run docs:build_ubuntu
|
||||||
touch .vitepress/dist/.nojekyll
|
touch .vitepress/dist/.nojekyll
|
||||||
@@ -91,14 +101,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload HTML with short cache
|
- name: Upload HTML with short cache
|
||||||
run: |
|
run: |
|
||||||
aws s3 sync ~/_book/ s3://px4-docs/${{ env.BRANCH_NAME }}/ \
|
aws s3 sync ~/_book/ s3://px4-docs/${{ needs.build.outputs.releaseversion }}/ \
|
||||||
--delete \
|
--delete \
|
||||||
--exclude "*" --include "*.html" \
|
--exclude "*" --include "*.html" \
|
||||||
--cache-control "public, max-age=60"
|
--cache-control "public, max-age=60"
|
||||||
|
|
||||||
- name: Upload assets with long cache
|
- name: Upload assets with long cache
|
||||||
run: |
|
run: |
|
||||||
aws s3 sync ~/_book/ s3://px4-docs/${{ env.BRANCH_NAME }}/ \
|
aws s3 sync ~/_book/ s3://px4-docs/${{ needs.build.outputs.releaseversion }}/ \
|
||||||
--delete \
|
--delete \
|
||||||
--exclude "*.html" \
|
--exclude "*.html" \
|
||||||
--cache-control "public, max-age=86400, immutable"
|
--cache-control "public, max-age=86400, immutable"
|
||||||
Reference in New Issue
Block a user