kanidm/.github/workflows/kanidm_book.yml

101 lines
2.5 KiB
YAML
Raw Normal View History

---
name: GitHub Pages
"on":
push:
branches:
- "master"
pull_request:
# permissions list: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
2023-05-07 11:42:16 +02:00
permissions:
id-token: write
actions: read
checks: read
contents: write
deployments: write
issues: read
pull-requests: read
statuses: read
pages: write
2023-05-07 11:42:16 +02:00
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
generate_tags:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.tags.outputs.tags}}
latest: ${{ steps.previoustag.outputs.tag }}
steps:
- id: tags
name: pull tags
uses: oraad/get-tags-action@v1.0.0
with:
repo: ${{ github.repository }}
limit: 100
github-token: ${{ github.token }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
prefix: v1
fanout:
uses: './.github/workflows/kanidm_individual_book.yml'
needs: generate_tags
strategy:
fail-fast: false
matrix:
# tag: ${{ fromJson(needs.generate_tags.outputs.tags) }}
tag:
- ${{ needs.generate_tags.outputs.latest}}
with:
tag: ${{ matrix.tag }}
parent_id: ${{ github.ref }}
docs_master:
uses: './.github/workflows/kanidm_individual_book.yml'
with:
tag: "master"
parent_id: ${{ github.ref }}
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'kanidm/kanidm' }}
needs:
- fanout
- docs_master
- generate_tags
runs-on: ubuntu-latest
steps:
- name: Download previously built docs
uses: actions/download-artifact@v3
with:
name: docs
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Extract the files
run: |
find . -name '*.tar.gz' -exec tar zxf "{}" \;
ls -la docs/
cd docs && \
ln -s ${{ needs.generate_tags.outputs.latest}}/ stable && \
cd ..
ls -la docs/
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: 'docs/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2