-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from keirthana/automate-cmd-ref
Automate command reference content
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Automatically generate command reference topics | ||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
env: | ||
AMC_COMMAND_REFERENCE_DIR: "./reference/cmd-ref/amc" | ||
APPLIANCE_COMMAND_REFERENCE_DIR: "./reference/cmd-ref/appliance" | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Determine base version | ||
id: base_version | ||
run: | | ||
echo "value=$(cat .base_version)" >> "$GITHUB_OUTPUT" | ||
- name: Setup Anbox Cloud | ||
uses: canonical/anbox-cloud-github-action@39490d442cc0921fe614f7044b9f3dc8bd89725c | ||
with: | ||
channel: ${{ steps.base_version.outputs.value }}/stable | ||
- name: Checkout repo | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
# Remove existing files, generate AMC command reference | ||
- name: Generate AMC command reference documentation | ||
run: | | ||
set -e | ||
rm -rf $AMC_COMMAND_REFERENCE_DIR/* | ||
amc generate documentation -f markdown -d $AMC_COMMAND_REFERENCE_DIR | ||
- name: Commit changes | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 | ||
with: | ||
default_author: github_actions | ||
message: 'Generate AMC command reference documentation' | ||
add: ${{ env.AMC_COMMAND_REFERENCE_DIR }} | ||
# Remove existing files, generate appliance command reference | ||
- name: Generate appliance command reference documentation | ||
env: | ||
SNAP_DOCS_DIR: "/var/snap/anbox-cloud-appliance/common/docs" | ||
# For the appliance command, the files have to be generated inside the Snap | ||
# and then copied to the desired directory because of Snap confinement | ||
run: | | ||
set -e | ||
rm -rf $APPLIANCE_COMMAND_REFERENCE_DIR/* | ||
sudo mkdir -p $SNAP_DOCS_DIR | ||
sudo anbox-cloud-appliance generate documentation -f markdown -d $SNAP_DOCS_DIR | ||
cp -r $SNAP_DOCS_DIR/* $APPLIANCE_COMMAND_REFERENCE_DIR | ||
- name: Commit changes | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 | ||
with: | ||
default_author: github_actions | ||
message: 'Generate appliance command reference documentation' | ||
add: ${{ env.APPLIANCE_COMMAND_REFERENCE_DIR }} |
Empty file.
Empty file.