Skip to content

chore(deps): bump shivammathur/setup-php from 2.37.1 to 2.37.2 #1900

chore(deps): bump shivammathur/setup-php from 2.37.1 to 2.37.2

chore(deps): bump shivammathur/setup-php from 2.37.1 to 2.37.2 #1900

name: "Build documentation index"
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
permissions:
contents: read
jobs:
build-and-deploy:
name: Build index.html
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
- name: Get stable branches
id: branch
run: |
branches=$(git ls-remote --heads origin "heads/stable[0-9][0-9]" | awk '{gsub(/^refs\/heads\/stable/, "", $2); print $2}' | sort -n -r | tr '\n' ' ')
echo "branches=$branches" >> $GITHUB_OUTPUT
- name: Setup php
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
- name: Generate index.html
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
php build/build-index.php ${{ steps.branch.outputs.branches }}
mv build/index.html /tmp/index.html
mv build/static/ /tmp/static/
- name: Verify index.html structure and links
run: |
# Temporarily put index.html in build folder for verification
cp /tmp/index.html build/index.html
php build/verify-index.php
- name: Checkout gh-pages branch
if: github.event_name == 'push'
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: gh-pages
fetch-depth: 1
persist-credentials: false
- name: Apply generated files to gh-pages
if: github.event_name == 'push'
run: |
rm -rf index.html static/
mv /tmp/index.html index.html
mv /tmp/static/ static/
- name: Create Pull Request for index deployment
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
id: cpr
if: github.event_name == 'push'
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
commit-message: "chore: update index.html for documentation"
committer: nextcloud-command <nextcloud-command@users.noreply.github.com>
author: nextcloud-command <nextcloud-command@users.noreply.github.com>
signoff: true
branch: "automated/deploy/documentation-index"
base: gh-pages
title: "Documentation index update"
body: |
This PR was automatically generated by the CI workflow and
includes the latest changes to the documentation index.
delete-branch: true
labels: "automated, 3. to review"
- name: Enable Pull Request Automerge
run: gh pr merge --merge --auto "${{ steps.cpr.outputs.pull-request-number }}"
if: steps.cpr.outputs.pull-request-number != ''
env:
GH_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}