Skip to content

Commit

Permalink
ci: Fix docs generation in releasing GitHub action (#157)
Browse files Browse the repository at this point in the history
This PR fixes doc links in readme and plugs doc generation just before
GitHub release, so that we have properly-versioned links in main README.
Now the doc for metal_device in main-branch README will point to

https://github.com/equinix-labs/ansible-collection-equinix/blob/v0.3.0/docs/modules/metal_device.md

(when v0.3.0 is the latest release)
  • Loading branch information
t0mk authored Feb 22, 2024
2 parents 9a84ebb + 9e95636 commit e66b497
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- name: checkout repo
uses: actions/checkout@v4
with:
path: .ansible/collections/ansible_collections/equinix/cloud
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_KEY }}

Expand All @@ -32,6 +33,7 @@ jobs:
- name: Do GitHub release
uses: cycjimmy/semantic-release-action@v4
with:
working_directory: .ansible/collections/ansible_collections/equinix/cloud
semantic_version: 19.0.5
extra_plugins: |
@semantic-release/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
[
"@semantic-release/exec",
{
"prepareCmd": "echo -n '${nextRelease.version}' > version"
"prepareCmd": "echo -n '${nextRelease.version}' > version && make docs"
}
],
[
Expand Down
6 changes: 3 additions & 3 deletions template/README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Modules for managing Equinix infrastructure.

Name | Description |
--- | ------------ |
{% for mod in modules %}[equinix.cloud.{{ mod.name }}]({% if is_release %}https://github.com/equinix-labs/ansible-collection-equinix/blob/{{ collection_version }}/docs/modules/{{ mod.name }}.md{% else %}./docs/modules/{{ mod.name }}.md{% endif %})|{{ mod.description }}|
{% for mod in modules %}[equinix.cloud.{{ mod.name }}]({% if is_release %}https://github.com/equinix-labs/ansible-collection-equinix/blob/v{{ collection_version }}/docs/modules/{{ mod.name }}.md{% else %}./docs/modules/{{ mod.name }}.md{% endif %})|{{ mod.description }}|
{% endfor %}

### Info Modules
Expand All @@ -32,7 +32,7 @@ Modules for retrieving information about existing Equinix infrastructure.

Name | Description |
--- | ------------ |
{% for mod in info_modules %}[equinix.cloud.{{ mod.name }}]({% if is_release %}https://github.com/equinix-labs/ansible-collection-equinix/blob/{{ collection_version }}/docs/modules/{{ mod.name }}.md{% else %}./docs/modules/{{ mod.name }}.md{% endif %})|{{ mod.description }}|
{% for mod in info_modules %}[equinix.cloud.{{ mod.name }}]({% if is_release %}https://github.com/equinix-labs/ansible-collection-equinix/blob/v{{ collection_version }}/docs/modules/{{ mod.name }}.md{% else %}./docs/modules/{{ mod.name }}.md{% endif %})|{{ mod.description }}|
{% endfor %}

### Inventory Plugins
Expand All @@ -41,7 +41,7 @@ Dynamically add Equinix infrastructure to an Ansible inventory.

Name |
--- |
{% for name in inventory %}[equinix.cloud.{{ name }}]({% if is_release %}https://github.com/equinix-labs/ansible-collection-equinix/blob/{{ collection_version }}/docs/inventory/{{ name }}.md{% else %}./docs/inventory/{{ name }}.rst{% endif %})|
{% for name in inventory %}[equinix.cloud.{{ name }}]({% if is_release %}https://github.com/equinix-labs/ansible-collection-equinix/blob/v{{ collection_version }}/docs/inventory/{{ name }}.md{% else %}./docs/inventory/{{ name }}.rst{% endif %})|
{% endfor %}

<!--end collection content-->
Expand Down

0 comments on commit e66b497

Please sign in to comment.