2022-09-08 08:40:58 +02:00
|
|
|
---
|
2021-07-24 03:12:35 +02:00
|
|
|
name: GitHub Pages
|
|
|
|
|
2022-04-28 05:45:48 +02:00
|
|
|
"on":
|
2021-07-24 03:12:35 +02:00
|
|
|
push:
|
2023-05-05 13:08:54 +02:00
|
|
|
branches:
|
|
|
|
- "master"
|
|
|
|
pull_request:
|
2021-07-24 03:12:35 +02:00
|
|
|
|
2023-05-07 12:52:13 +02:00
|
|
|
# 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
|
2023-05-07 12:52:13 +02:00
|
|
|
pages: write
|
2023-05-07 11:42:16 +02:00
|
|
|
|
2022-11-13 23:57:05 +01:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2021-07-24 03:12:35 +02:00
|
|
|
jobs:
|
2023-04-18 13:35:40 +02:00
|
|
|
generate_tags:
|
2021-07-24 03:12:35 +02:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-18 13:35:40 +02:00
|
|
|
outputs:
|
|
|
|
tags: ${{ steps.tags.outputs.tags}}
|
|
|
|
latest: ${{ steps.previoustag.outputs.tag }}
|
2021-07-24 03:12:35 +02:00
|
|
|
steps:
|
2023-04-18 13:35:40 +02:00
|
|
|
- id: tags
|
|
|
|
name: pull tags
|
|
|
|
uses: oraad/get-tags-action@v1.0.0
|
|
|
|
with:
|
|
|
|
repo: ${{ github.repository }}
|
|
|
|
limit: 100
|
2023-05-26 08:36:46 +02:00
|
|
|
github-token: ${{ github.token }}
|
2022-04-28 05:45:48 +02:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-04-18 13:35:40 +02:00
|
|
|
- name: 'Get Previous tag'
|
|
|
|
id: previoustag
|
|
|
|
uses: "WyriHaximus/github-action-get-previous-tag@v1"
|
2022-12-26 23:52:03 +01:00
|
|
|
with:
|
2023-04-18 13:35:40 +02:00
|
|
|
prefix: v1
|
|
|
|
fanout:
|
|
|
|
uses: './.github/workflows/kanidm_individual_book.yml'
|
|
|
|
needs: generate_tags
|
2022-12-26 23:52:03 +01:00
|
|
|
|
2023-04-18 13:35:40 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
# tag: ${{ fromJson(needs.generate_tags.outputs.tags) }}
|
|
|
|
tag:
|
2023-04-25 14:36:17 +02:00
|
|
|
- ${{ needs.generate_tags.outputs.latest}}
|
2023-04-18 13:35:40 +02:00
|
|
|
with:
|
|
|
|
tag: ${{ matrix.tag }}
|
|
|
|
parent_id: ${{ github.ref }}
|
|
|
|
docs_master:
|
|
|
|
uses: './.github/workflows/kanidm_individual_book.yml'
|
|
|
|
with:
|
|
|
|
tag: "master"
|
|
|
|
parent_id: ${{ github.ref }}
|
2022-12-26 23:52:03 +01:00
|
|
|
|
2023-04-18 13:35:40 +02:00
|
|
|
deploy:
|
2023-05-07 04:44:30 +02:00
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'kanidm/kanidm' }}
|
|
|
|
|
2023-04-18 13:35:40 +02:00
|
|
|
needs:
|
|
|
|
- fanout
|
|
|
|
- docs_master
|
|
|
|
- generate_tags
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Download previously built docs
|
|
|
|
uses: actions/download-artifact@v3
|
2021-07-24 03:12:35 +02:00
|
|
|
with:
|
2023-04-18 13:35:40 +02:00
|
|
|
name: docs
|
2023-05-07 04:44:30 +02:00
|
|
|
- name: Setup Pages
|
|
|
|
uses: actions/configure-pages@v3
|
2023-04-18 13:35:40 +02:00
|
|
|
- name: Extract the files
|
2023-04-25 14:36:17 +02:00
|
|
|
run: |
|
2023-04-18 13:35:40 +02:00
|
|
|
find . -name '*.tar.gz' -exec tar zxf "{}" \;
|
|
|
|
ls -la docs/
|
2023-04-25 14:36:17 +02:00
|
|
|
cd docs && \
|
|
|
|
ln -s ${{ needs.generate_tags.outputs.latest}}/ stable && \
|
|
|
|
cd ..
|
2023-04-18 13:35:40 +02:00
|
|
|
ls -la docs/
|
2023-05-05 13:08:54 +02:00
|
|
|
|
2023-05-07 04:44:30 +02:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-pages-artifact@v1
|
2023-05-05 13:08:54 +02:00
|
|
|
with:
|
2023-05-07 04:44:30 +02:00
|
|
|
# Upload entire repository
|
|
|
|
path: 'docs/'
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v2
|