Skip to content

Commit

Permalink
Create upload-dokka-docs.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
daytime-em authored Nov 17, 2023
1 parent 2034c89 commit 961ceaa
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/upload-dokka-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Workflow for updating devdocs.mux.com with new documentation every time a new version is released
#
# Ths workflow assumes your releases are tagged either "vX.X.X" or "X.X.X", where X is a number of any length
#
# REQUIRED SECRETS:
# AWS_DOCS_KEY
# AWS_DOCS_SECRET
# DOCS_REPO_PAT
# REQUIRED CONFIGURATION:
# You have to change 'player-android' to match a URL slug for your docs, like 'upload-android' or 'data-exoplayer'
# You have to supply the path to your dokka output. The default is library/build/dokka/html
# You may need to change the name of the Gradle task used for generating your Dokka docs
name: Upload Dokka DevDocs

on:
release:
types:
- published
workflow_dispatch:

jobs:
devdocs:
runs-on: ubuntu-latest
name: Generate and Upload Dokka Docs

env:
AWS_EC2_METADATA_DISABLED: true

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Parse the version out of the tag name
id: version
run: >
echo "version_name="$(echo ${{ github.event.release.tag_name }} | sed -E "s/^v//")"" >> $GITHUB_OUTPUT
- name: Configure AWS
run: >
aws configure set aws_access_key_id ${{ secrets.AWS_DOCS_KEY }};
aws configure set aws_secret_access_key ${{ secrets.AWS_DOCS_SECRET }}
# If you have a multi-module project or monorepo, you'll need to repeat these steps
# POSSIBLE CONFIGURATION: make sure the `arguments:` tag matches the correct task(s) for your project
- name: Build Dokka Docs
uses: gradle/[email protected]
with:
arguments: ':library:dokkaHtml'
# REQUIRED CONFIGURATION: You have to change player-android to a suitable URL slug for your project
- name: Update the docs AWS bucket
run: |
aws s3 rm --recursive "s3://mux-devdocs/player-android/latest/"
aws s3 sync library/build/dokka/html s3://mux-devdocs/player-android/${{ steps.version.outputs.version_name }}/
aws s3 sync library/build/dokka/html s3://mux-devdocs/player-android/latest/
- name: Update the devdocs site
run: |
echo "${{ secrets.DOCS_REPO_PAT }}" | gh auth login --with-token
gh workflow run -R muxinc/devdocs-directory deploy-to-s3

0 comments on commit 961ceaa

Please sign in to comment.