running rundoc on tutorials #9
Workflow file for this run
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: run-rundoc | |
run-name: running rundoc on tutorials | |
on: | |
schedule: | |
# This schedule triggers the workflow at 00:00 every Monday | |
- cron: '0 0 * * 1' | |
workflow_dispatch: | |
jobs: | |
rundoc-ubuntu: | |
runs-on: pub-hk-ubuntu-24.04-ip | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Get token for GH application (Linguist) | |
uses: actions/create-github-app-token@v1 | |
id: generate-token | |
with: | |
app-id: ${{ vars.LINGUIST_GH_APP_ID }} | |
private-key: ${{ secrets.LINGUIST_GH_PRIVATE_KEY }} | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ steps.generate-token.outputs.token }} | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3.2' | |
bundler-cache: true # do run 'bundle install' and cache | |
working-directory: .rundoc-workspace | |
- uses: buildpacks/github-actions/[email protected] | |
# [CONFIG] different languages set up here | |
- run: bundle exec rundoc ../docs/src/ruby/ruby_tutorial.md --on-success-dir ../docs/ruby --on-failure-dir ../docs/fail --force | |
working-directory: .rundoc-workspace | |
- run: rm -rf ruby-getting-started | |
working-directory: docs/ruby | |
- name: Create Pull Request | |
id: pr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
branch: rundoc-update | |
delete-branch: true | |
base: main | |
commit-message: run rundoc on tutorials | |
title: Update tutorials | |
body: "generated by the [run-rundoc linux github action](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" | |
committer: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}> | |
author: ${{ vars.LINGUIST_GH_APP_USERNAME }} <${{ vars.LINGUIST_GH_APP_EMAIL }}> | |
- name: Enable PR auto-merge | |
if: steps.pr.outputs.pull-request-operation == 'created' | |
run: gh pr merge --auto --squash "${{ steps.pr.outputs.pull-request-number }}" | |
env: | |
GH_TOKEN: ${{ steps.generate-token.outputs.token }} | |