Skip to content

Update permissions.

Update permissions. #7

name: documentation
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Swift dependencies
run: |
sudo apt-get install clang libicu-dev
wget https://download.swift.org/swift-5.10-release/ubuntu2204/swift-5.10-RELEASE/swift-5.10-RELEASE-ubuntu22.04.tar.gz
tar xzf swift-5.10-RELEASE-ubuntu22.04.tar.gz
echo "$(pwd)/swift-5.10-RELEASE-ubuntu22.04/usr/bin" >> $GITHUB_PATH
- name: Clean up documentation branch
run: |
git branch -D documentation || true
git checkout -b documentation
- name: Run docc
run: |
cd "${GITHUB_WORKSPACE}"
docc convert Documentation.docc --index --transform-for-static-hosting --output-path ./docs
echo '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=https://drawthingsai.github.io/documentation/root">' > ./docs/index.html
- name: Add and commit documentation
run: |
git config --global user.email "[email protected]"
git config --global user.name "docbot"
cd "${GITHUB_WORKSPACE}" && git add "docs/*" && git commit -m "Update docs."
- name: Push the new branch
run: |
cd "${GITHUB_WORKSPACE}" && git push --force origin documentation:documentation