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
25 changes: 22 additions & 3 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,39 @@ on:
description: Dry run (only list files, don't upload)
default: true
type: boolean
ref:
description: Git ref to get docs from (branch, tag, or SHA)
default: main
type: string
release:
types: [published]
jobs:
publish:
name: Publish Docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.ref || 'main' }}
fetch-depth: 0
fetch-tags: true

- name: Get Commit SHA
id: get_commit
run: |
COMMIT_SHA=$(git rev-parse HEAD)
echo "commit_sha=${COMMIT_SHA}" >> $GITHUB_OUTPUT
echo "Using commit SHA: ${COMMIT_SHA}"

- name: Download Archive
uses: dawidd6/action-download-artifact@v9
with:
workflow: ci.yaml
workflow_search: false
branch: main
commit: ${{ steps.get_commit.outputs.commit_sha }}
name: docs
if_no_artifact_found: fail

- name: Unzip Archive
run: unzip docs.zip
Expand All @@ -28,15 +47,15 @@ jobs:
run: ls -la docs

- name: S3 Upload
if: inputs.dry_run != true
if: github.event_name == 'release' || github.event.inputs.dry_run != 'true'
run: aws s3 cp docs/ s3://livekit-docs/client-sdk-swift --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }}
AWS_DEFAULT_REGION: "us-east-1"

- name: Invalidate cache
if: inputs.dry_run != true
if: github.event_name == 'release' || github.event.inputs.dry_run != 'true'
run: aws cloudfront create-invalidation --distribution-id EJJ40KLJ3TRY9 --paths "/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
Expand Down
Loading