forked from ansible/ansible-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (77 loc) · 2.5 KB
/
build-package-docs.yaml
File metadata and controls
79 lines (77 loc) · 2.5 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
name: Build and deploy docs
"on":
schedule:
# Run at 05:17 on Tuesday and Thursday
- cron: '17 5 * * 2,4'
workflow_dispatch:
inputs:
repository-owner:
description: GitHub account or org that owns the repository
type: string
required: true
default: ansible
repository-name:
description: Name of the GitHub repository
type: string
required: true
default: ansible-documentation
repository-branch:
description: Branch, tag, or commit SHA
type: string
required: true
default: devel
ansible-package-version:
description: Ansible community package version
type: choice
required: true
default: devel
options:
- devel
- '12'
- '11'
- '10'
- '9'
generate-redirects:
description: Generate page redirects
type: boolean
default: true
deploy:
description: Deploy the build
type: boolean
required: true
default: false
deployment-environment:
description: Deployment environment
type: choice
required: true
default: test
options:
- production
- test
jobs:
build-package-docs:
name: 📝 Build
uses: ./.github/workflows/reusable-build-docs.yaml
with:
repository-owner: ${{ github.event.inputs.repository-owner || 'ansible' }}
repository-name: ${{ github.event.inputs.repository-name || 'ansible-documentation' }}
repository-branch: ${{ github.event.inputs.repository-branch || 'devel' }}
ansible-package-version: ${{ github.event.inputs.ansible-package-version || 'devel' }}
generate-redirects: >-
${{ github.event_name == 'workflow_dispatch'
&& github.event.inputs.generate-redirects == 'true' }}
secrets:
DOCS_BOT_TOKEN: ${{ secrets.DOCS_BOT_TOKEN }}
deploy-package-docs:
name: 🚀 Deploy
if: github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true'
needs: build-package-docs
uses: ./.github/workflows/reusable-deploy-docs.yaml
with:
ansible-package-version: ${{ github.event.inputs.ansible-package-version }}
deployment-environment: ${{ github.event.inputs.deployment-environment }}
repository-owner: ${{ github.event.inputs.repository-owner }}
repository-branch: ${{ github.event.inputs.repository-branch }}
secrets:
DEPLOY_DOC_BUILD: ${{ secrets.DEPLOY_DOC_BUILD }}