Skip to content

Merge pull request #12 from QiuZhiFei/dev #41

Merge pull request #12 from QiuZhiFei/dev

Merge pull request #12 from QiuZhiFei/dev #41

Workflow file for this run

name: Jazzy
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
Jazzy:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: ENV
run: |
uname -a
swift --version
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Build
run: |
swift build -v
- name: Generate documentation json
run: |
brew install sourcekitten
sourcekitten doc --spm --module-name Commands > commands.json
- name: Run jazzy
run: |
bundle exec jazzy --clean --sourcekitten-sourcefile commands.json
- uses: actions/upload-artifact@v4
with:
name: API Docs
path: docs
- name: Push to gh-pages
if: github.event_name == 'push'
run: |
git config --global user.email "${GITHUB_ACTOR}"
git config --global user.name "${GITHUB_ACTOR}@users.noreply.github.com"
git clone "https://x-access-token:${PRIVATE_GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" out
cd out
git checkout -B gh-pages
git rm -rf .
cd ..
cp -a docs/. out/.
cd out
git add -A
git commit -m "Automated deployment to GitHub Pages: ${GITHUB_SHA}" --allow-empty
git remote -v
git config --global user.name
git push origin gh-pages -f
env:
PRIVATE_GITHUB_TOKEN: ${{ secrets.PRIVATE_GITHUB_TOKEN }}