-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsite-deploy.yml
59 lines (51 loc) · 2.33 KB
/
site-deploy.yml
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
################################################################################
# Copyright (c) IBM Corporation 2020, 2021
################################################################################
################################################################################
# Description:
# This playbook will deploy the documentation that has been generated by
# the playbook `site-builder.yml`. It will checkout the gh-pages submodule,
# copy all the generated HTML, commit it with a static description and
# push it to the repository assuming your ID has write permissions in this
# repository and finally present the URL you can view the newly published
# documentation.
# Usage:
# ansible-playbook -i inventory site-deploy.yml
################################################################################
---
- hosts: all
connection: local
- name: Partially tearing down to be save to avoid undesirable commits
import_playbook: site-teardown.yml
vars:
set_make_clean: false
- hosts: all
gather_facts: no
connection: local
tasks:
############################################################################
# Copy the content generated by site-builder.yml` and perform the steps
# to release and publish the content.
############################################################################
- name: Copy the generated HTML from `build/html/` to `site/gh-pages/`
shell: |
cd site/gh-pages
git checkout gh-pages
cp -R ../../build/html/* .
git add .
git status
git commit -m "Automated commit to update documentation"
git push -f
cd ../..
git checkout main
git status
git submodule update
register: git_update_doc
- name: Display the HTML content uploaded to the doc site (gh-pages)
debug: msg="{{ git_update_doc }}"
############################################################################
# Display the URL to which one can view the newly published documentation.
# https://ibm.github.io/z_ansible_collections_doc/index.html
############################################################################
- name: Follow this URL to view the updated collection content
debug: msg="https://ibm.github.io/z_ansible_collections_doc/index.html"