Skip to content

Change license headers #37

Change license headers

Change license headers #37

name: Publish CLI reference to documentation
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "cli/**"
- "hack/clidocgen/**"
jobs:
publish-to-docs:
runs-on: ubuntu-24.04
container:
image: ghcr.io/edgelesssys/edgelessrt-dev:ci
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
- name: Setup
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Generate reference docs
run: XDG_CONFIG_HOME=\$HOME/.config go run . | cat header.md - > ../../cli.md
working-directory: hack/clidocgen
- name: Get commit sha
run: |
echo "COMMIT_END=$(echo ${{ github.sha }} | cut -c1-8)" >> "$GITHUB_ENV"
- name: Check if action branch exists
shell: bash -e {0}
run: |
ex="$(git ls-remote --heads origin action/marblerun/update-cli-reference)"
echo "EXISTS=$(if [[ -z "$ex" ]]; then echo 0; else echo 1; fi)" >> "$GITHUB_ENV"
- name: Publish new reference (create new branch)
if: ${{ env.EXISTS == 0 }}
uses: dmnemec/copy_file_to_another_repo_action@c93037aa10fa8893de271f19978c980d0c1a9b37 # v1.1.1
env:
API_TOKEN_GITHUB: ${{ secrets.CI_GITHUB_REPOSITORY }}
with:
source_file: "cli.md"
destination_repo: "edgelesssys/marblerun"
destination_branch: "master"
destination_branch_create: "action/marblerun/update-cli-reference"
destination_folder: "docs/docs/reference"
user_name: "${{ github.actor }}"
user_email: "${{ github.actor }}@users.noreply.github.com"
commit_message: "CLI reference was updated by edgelesssys/marblerun@${{ env.COMMIT_END}}"
- name: Publish new reference (update branch)
if: ${{ env.EXISTS == 1 }}
uses: dmnemec/copy_file_to_another_repo_action@c93037aa10fa8893de271f19978c980d0c1a9b37 # v1.1.1
env:
API_TOKEN_GITHUB: ${{ secrets.CI_GITHUB_REPOSITORY }}
with:
source_file: "cli.md"
destination_repo: "edgelesssys/marblerun"
destination_branch: "action/marblerun/update-cli-reference"
destination_folder: "docs/docs/reference"
user_name: "${{ github.actor }}"
user_email: "${{ github.actor }}@users.noreply.github.com"
commit_message: "CLI reference was updated by edgelesssys/marblerun@${{ env.COMMIT_END}}"