docs: fix deploy variables (#25685)

* ci: docs try again

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci: try to fix docs deploy syntax

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci: test for main and release/1.16

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

---------

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
Ramon Roche
2025-09-30 19:30:51 -07:00
committed by GitHub
parent 12601ac1c4
commit 81d97cc81d
+9 -22
View File
@@ -5,18 +5,9 @@ on:
branches:
- "main"
- "release/**"
paths:
- "docs/en/**"
pull_request:
branches:
- "**"
paths:
- "docs/en/**"
- "docs/zh/**"
- "docs/uk/**"
- "docs/ko/**"
workflow_dispatch:
permissions:
contents: read
@@ -28,15 +19,7 @@ concurrency:
jobs:
build:
runs-on:
[
runs-on,
runner=8cpu-linux-x64,
image=ubuntu24-full-x64,
"run-id=${{ github.run_id }}",
spot=false,
extras=s3-cache,
]
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
outputs:
branchname: ${{ steps.set-branch.outputs.branchname }}
releaseversion: ${{ steps.set-version.outputs.releaseversion }}
@@ -52,7 +35,11 @@ jobs:
- id: set-version
run: |
branch="${{ steps.set-branch.outputs.branchname }}"
version="v${branch#release/}"
if [[ "$branch" == "main" ]]; then
version="main"
else
version="v${branch#release/}"
fi
echo "::set-output name=releaseversion::$version"
- name: Setup Node
@@ -85,7 +72,7 @@ jobs:
deploy:
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged) || github.event_name == 'workflow_dispatch' }}
needs: build
runs-on: ubuntu-latest
runs-on: [runs-on,runner=4cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
steps:
- name: Download Artifact
@@ -105,14 +92,14 @@ jobs:
- name: Upload HTML with short cache
run: |
aws s3 sync ~/_book/ s3://px4-docs/${{ needs.build.outputs.versionname }}/ \
aws s3 sync ~/_book/ s3://px4-docs/${{ needs.build.outputs.releaseversion }}/ \
--delete \
--exclude "*" --include "*.html" \
--cache-control "public, max-age=60"
- name: Upload assets with long cache
run: |
aws s3 sync ~/_book/ s3://px4-docs/${{ needs.build.outputs.versionname }}/ \
aws s3 sync ~/_book/ s3://px4-docs/${{ needs.build.outputs.releaseversion }}/ \
--delete \
--exclude "*.html" \
--cache-control "public, max-age=86400, immutable"