generate_full_docs #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: generate_full_docs | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
generate_docs: | |
name: Generate Docs | |
runs-on: macos-latest | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v2 | |
with: | |
ref: main | |
- name: Select the latest Xcode version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: 'latest' | |
- name: Setup Ruby 3.3.0 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3.0 | |
bundler-cache: true | |
- name: Install Fastlane and Jazzy using gem | |
run: | | |
gem install fastlane | |
gem install jazzy | |
- name: Install SourceDocs using Homebrew | |
run: | | |
brew install sourcedocs | |
- name: Install dependencies (Pods) | |
run: | | |
pod install | |
- name: Run Fastlane to generate full documentation | |
run: | | |
fastlane generate_full_docs | |
- name: Setup Git user (GitHub Actions bot) | |
run: | | |
git config user.name TelnyxIntegrations | |
git config user.email [email protected] | |
- name: Create new branch for docs | |
run: | | |
BRANCH_NAME="docs/update-$(date +'%Y%m%d%H%M%S')" | |
git checkout -b $BRANCH_NAME | |
- name: Commit changes | |
run: | | |
git add docs/ docs_markdown/ | |
git commit -m "docs: Generated full documentation" || echo "No changes to commit" | |
- name: Push changes to new branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "Pushing to branch: $BRANCH_NAME" | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
git push --set-upstream origin $BRANCH_NAME | |
- name: Create Pull Request using GitHub Actions bot | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
head: $BRANCH_NAME | |
base: main | |
title: "docs: Update generated documentation" | |
body: "This PR updates the full documentation generated by Fastlane and Jazzy." | |
labels: "documentation, auto-generated" |