Skip to content
Snippets Groups Projects
Commit 87c4a04c authored by EricFromCanada's avatar EricFromCanada
Browse files

workflows: add `apidoc` workflow for rubydoc.brew.sh

parent 5194870b
No related branches found
No related tags found
No related merge requests found
workflow "Push" {
on = "push"
resolves = ["Generate rubydoc.brew.sh"]
}
action "Generate rubydoc.brew.sh" {
uses = "docker://ruby:latest"
runs = ".github/main.workflow.sh"
secrets = ["RUBYDOC_DEPLOY_KEY"]
}
#!/bin/bash
set -e
# silence bundler complaining about being root
mkdir ~/.bundle
echo 'BUNDLE_SILENCE_ROOT_WARNING: "1"' > ~/.bundle/config
# configure git
git config --global user.name "BrewTestBot"
git config --global user.email "homebrew-test-bot@lists.sfconservancy.org"
# setup SSH
mkdir ~/.ssh
chmod 700 ~/.ssh
echo "$RUBYDOC_DEPLOY_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
git config --global core.sshCommand "ssh -i ~/.ssh/id_ed25519 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
# clone rubydoc.brew.sh with SSH so we can push back
git clone git@github.com:Homebrew/rubydoc.brew.sh
cd rubydoc.brew.sh
# clone latest Homebrew/brew
git clone --depth=1 https://github.com/Homebrew/brew
# run rake to build documentation
gem install bundler
bundle install
bundle exec rake
# commit and push generated files
git add docs
git diff --exit-code HEAD -- docs && exit 0
git commit -m 'docs: update from Homebrew/brew push' docs
git push
name: Generate rubydoc.brew.sh
on:
push:
branches: master
jobs:
apidoc:
runs-on: ubuntu-latest
steps:
- uses: docker://ruby:latest
- uses: Homebrew/actions/git-ssh@master
with:
git_user: BrewTestBot
git_email: homebrew-test-bot@lists.sfconservancy.org
key: ${{ secrets.RUBYDOC_DEPLOY_KEY }}
- run: |
# silence bundler complaining about being root
mkdir ~/.bundle
echo 'BUNDLE_SILENCE_ROOT_WARNING: "1"' > ~/.bundle/config
# clone rubydoc.brew.sh with SSH so we can push back
git clone git@github.com:Homebrew/rubydoc.brew.sh
cd rubydoc.brew.sh
# clone latest Homebrew/brew
git clone --depth=1 https://github.com/Homebrew/brew
# run rake to build documentation
gem install bundler
bundle install
bundle exec rake
# commit and push generated files
git add docs
if ! git diff --exit-code HEAD -- docs; then
git commit -m 'docs: update from Homebrew/brew push' docs
git push
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment