mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 12:37:00 +01:00
106 lines
2.7 KiB
YAML
106 lines
2.7 KiB
YAML
---
|
|
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
|
|
permissions:
|
|
id-token: write
|
|
actions: read
|
|
checks: read
|
|
contents: write
|
|
deployments: write
|
|
issues: read
|
|
pull-requests: read
|
|
statuses: read
|
|
pages: write
|
|
|
|
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
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@v3
|
|
- name: Extract the files
|
|
run: |
|
|
cp book/index_redirect.html docs/index.html
|
|
find . -name '*.tar.gz' -exec tar zxf "{}" \;
|
|
ls -la docs/
|
|
cd docs && \
|
|
ln -s ${{ needs.generate_tags.outputs.latest}}/ stable && \
|
|
cd ..
|
|
cp book/index_redirect.html docs/index.html
|
|
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
|