2023-03-13 19:31:10 +00:00
|
|
|
---
|
|
|
|
name: Collection Docs
|
|
|
|
concurrency:
|
|
|
|
group: docs-push-${{ github.sha }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
# Run CI once per day (at 06:00 UTC)
|
|
|
|
schedule:
|
|
|
|
- cron: '0 6 * * *'
|
|
|
|
# Allow manual trigger (for newer antsibull-docs, sphinx-ansible-theme, ... versions)
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
2024-05-30 18:30:47 +00:00
|
|
|
get-tags:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
latest: ${{ steps.get-latest-tag.outputs.latest_tag }}
|
|
|
|
steps:
|
|
|
|
- name: Get the latest tag
|
|
|
|
id: get-latest-tag
|
2024-06-06 16:42:11 +00:00
|
|
|
uses: actions/github-script@v7
|
2024-05-30 18:30:47 +00:00
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const latestTag = await github.rest.repos.listTags({
|
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: context.repo.repo,
|
|
|
|
per_page: 1
|
|
|
|
});
|
|
|
|
core.setOutput('latest_tag', latestTag.data[0].name);
|
|
|
|
|
2023-03-13 19:31:10 +00:00
|
|
|
build-docs:
|
2024-05-30 18:30:47 +00:00
|
|
|
name: Build Ansible Docs
|
|
|
|
needs: get-tags
|
2023-03-13 19:31:10 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-push.yml@main
|
|
|
|
with:
|
|
|
|
collection-name: prometheus.prometheus
|
|
|
|
init-lenient: false
|
|
|
|
init-fail-on-error: true
|
|
|
|
squash-hierarchy: true
|
|
|
|
init-project: Prometheus.Prometheus Collection
|
|
|
|
init-copyright: Prometheus.Prometheus Contributors
|
|
|
|
init-title: Prometheus.Prometheus Collection Documentation
|
|
|
|
init-html-short-title: Prometheus.Prometheus Collection Docs
|
|
|
|
init-extra-html-theme-options: |
|
2024-05-30 18:30:47 +00:00
|
|
|
documentation_home_url=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/tag/${{ needs.get-tags.outputs.latest }}
|
2023-03-13 19:31:10 +00:00
|
|
|
|
|
|
|
publish-docs-gh-pages:
|
|
|
|
# for now we won't run this on forks
|
|
|
|
if: github.repository == 'prometheus-community/ansible'
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
needs: [build-docs]
|
|
|
|
name: Publish Ansible Docs
|
|
|
|
uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-publish-gh-pages.yml@main
|
|
|
|
with:
|
|
|
|
artifact-name: ${{ needs.build-docs.outputs.artifact-name }}
|
|
|
|
secrets:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|