Skip to content

Doc publish fix #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
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
10 changes: 3 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,12 @@ jobs:
--transform-for-static-hosting \
--hosting-base-path client-sdk-swift/

- name: Sanitize Ref Name
id: sanitize-ref
run: echo "ref_name=$(echo ${{ github.ref_name }} | sed 's/\//-/g')" >> $GITHUB_OUTPUT

- name: Archive
run: zip -r docs@${{ steps.sanitize-ref.outputs.ref_name }}.zip docs
run: zip -r docs.zip docs

- name: Upload Archive
uses: actions/upload-artifact@v4
with:
name: docs@${{ steps.sanitize-ref.outputs.ref_name }}
path: docs@${{ steps.sanitize-ref.outputs.ref_name }}.zip
name: docs
path: docs.zip
retention-days: 1
19 changes: 12 additions & 7 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
name: Publish Docs
on:
workflow_dispatch:
inputs:
dry_run:
description: Dry run (only list files, don't upload)
default: true
type: boolean
release:
types: [published]
jobs:
publish:
name: Publish Docs
runs-on: ubuntu-latest
steps:
- name: Sanitize Ref Name
id: sanitize-ref
run: echo "ref_name=$(echo ${{ github.ref_name }} | sed 's/\//-/g')" >> $GITHUB_OUTPUT

- name: Download Archive
uses: dawidd6/action-download-artifact@v9
with:
workflow: ci.yaml
workflow_search: false
workflow_conclusion: success
branch: main
name: docs@${{ steps.sanitize-ref.outputs.ref_name }}
name: docs

- name: Unzip Archive
run: unzip docs@${{ steps.sanitize-ref.outputs.ref_name }}.zip
run: unzip docs.zip

- name: List Files
run: ls -la docs

- name: S3 Upload
if: 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
run: aws cloudfront create-invalidation --distribution-id EJJ40KLJ3TRY9 --paths "/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
Expand Down
Loading