Skip to content

generating P.sh CLI command doc page #15

generating P.sh CLI command doc page

generating P.sh CLI command doc page #15

name: Generate CLI commands doc page
on: [pull_request]
# pull_request:
# branches: [main]
# types: [labeled,opened,unlabeled,synchronize]
env:
PLATFORMSH_CLI_NO_INTERACTION: 1
PLATFORM_PROJECT: ${{ vars.PROJECT_ID }}
PLATFORMSH_CLI_DEFAULT_TIMEOUT: 60 # Increase timeout for CLI commands
SLEEP_TIME: 5
NUM_TRIES: 30
BRANCH_TITLE: ${{ vars.BFF_PREFIX }}-${{ github.event.number }}
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.WORKFLOW_TOKEN }}
# Set up workflow environment to use the Platform.sh CLI
- name: Set up Platform.sh CLI
uses: ./.github/actions/set-up-cli
- name: Create CLI Commands doc page
run: platform list --format=md > sites/platform/src/administration/cli/reference.html
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: CLI command doc page generator
author_email: [email protected]
message: 'generating Platform CLI command doc page'
add: 'sites/platform/src/administration/cli/reference.html'
# # Generate CLI command doc pages
# - env:
# PLATFORMSH_CLI_TOKEN: ${{ secrets.PLATFORMSH_CLI_TOKEN }}
# # @see activate_environment:Set environment title:env in manage-environment.yaml
# PR_TITLE: ${{ github.event.pull_request.title }}
# run: |
# # Get most recent changes
# git checkout ${{ github.event.pull_request.head.sha }}
#
# # Put most recent changes on the branch
# echo "Switching to branch ${{ env.BRANCH_TITLE }}"
# git switch -C ${{ env.BRANCH_TITLE }}
#
# # Adding CLI Commands specific page
# currentTitle=$(platform environment:info -e ${{ github.event.pull_request.head.ref }} title)
# echo "Current Title"
# echo $currentTitle
#
# echo "Generating Platform.sh CLI doc page"
# platform list --format=md > platform-commands.html
# git add platform-commands.html
# git commit -m "generating Platform CLI command doc page"
#
# cat platform-commands.html
#
# echo "Pushing most recent changes"
# #git push --force origin ${{ env.BRANCH_TITLE }}