github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/.github/workflows/publish-technical-documentation-release.yml (about)

     1  name: "publish-technical-documentation-release"
     2  
     3  on:
     4    push:
     5      branches:
     6        - "release-*"
     7      tags:
     8        - "v[0-9]+.[0-9]+.[0-9]+"
     9      paths:
    10        - "docs/sources/**"
    11    workflow_dispatch:
    12  jobs:
    13    test:
    14      runs-on: "ubuntu-latest"
    15      steps:
    16        - name: "Check out code"
    17          uses: "actions/checkout@v3"
    18        - name:
    19            "Build website"
    20            # -e HUGO_REFLINKSERRORLEVEL=ERROR prevents merging broken refs with the downside
    21            # that no refs to external content can be used as these refs will not resolve in the
    22            # docs-base image.
    23          run: |
    24            docker run -v ${PWD}/docs/sources:/hugo/content/docs/loki/release -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'make hugo'
    25  
    26    sync:
    27      runs-on: "ubuntu-latest"
    28      needs: "test"
    29      steps:
    30        - name: "Checkout code and tags"
    31          uses: "actions/checkout@v3"
    32          with:
    33            fetch-depth: 0
    34  
    35        - name: "Checkout Actions library"
    36          uses: "actions/checkout@v3"
    37          with:
    38            repository: "grafana/grafana-github-actions"
    39            path: "./actions"
    40  
    41        - name: "Install Actions from library"
    42          run: "npm install --production --prefix ./actions"
    43  
    44        - name: "Determine if there is a matching release tag"
    45          id: "has-matching-release-tag"
    46          uses: "./actions/has-matching-release-tag"
    47          with:
    48            ref_name: "${{ github.ref_name }}"
    49            release_tag_regexp: "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
    50            release_branch_regexp: "^release-(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.x$"
    51  
    52        - name: "Determine technical documentation version"
    53          if: "steps.has-matching-release-tag.outputs.bool == 'true'"
    54          uses: "./actions/docs-target"
    55          id: "target"
    56          with:
    57            ref_name: "${{ github.ref_name }}"
    58  
    59        - name: "Clone website-sync Action"
    60          if: "steps.has-matching-release-tag.outputs.bool == 'true'"
    61          run: "git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.GH_BOT_ACCESS_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync"
    62  
    63        - name: "Publish to website repository (release)"
    64          if: "steps.has-matching-release-tag.outputs.bool == 'true'"
    65          uses: "./.github/actions/website-sync"
    66          id: "publish-release"
    67          with:
    68            repository: "grafana/website"
    69            branch: "master"
    70            host: "github.com"
    71            github_pat: "${{ secrets.GH_BOT_ACCESS_TOKEN }}"
    72            source_folder: "docs/sources"
    73            target_folder: "content/docs/loki/${{ steps.target.outputs.target }}.x"