This repository was archived by the owner on Dec 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (42 loc) · 1.86 KB
/
ce-provision-build-docs.yml
File metadata and controls
48 lines (42 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Build docs
# Run this workflow every time a new commit pushed to your repository
on: pull_request
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
build-docs:
# Name the Job
name: Build the documentation
# Set the type of machine to run on
runs-on: ubuntu-20.04
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
uses: actions/checkout@v2
# Configures global Git variables for committing
- name: Configure Git
run: |
git config --global user.email "sysadm@codeenigma.com"
git config --global user.name "Code Enigma CI"
# Builds the docs
- name: Build documentation
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git fetch
git checkout documentation
contribute/toc.sh
git add docs
git diff --quiet && git diff --staged --quiet || git commit -am 'GitHub Actions - Rebuilt documentation.' && git push origin documentation
shell: bash
# Create docs pull request
- name: Create a documentation pull request
if: ${{ github.event.pull_request.head.ref != 'documentation' && github.event.pull_request.base.ref == '1.x' }}
uses: devops-infra/action-pull-request@v0.4.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: documentation
target_branch: ${{ github.event.pull_request.base.ref }}
title: Documentation update.
body: "**Automated pull request** created by GitHub Actions because of a documentation update."