Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 9 additions & 22 deletions .github/workflows/docs_deploy_aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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"
Loading