-
Notifications
You must be signed in to change notification settings - Fork 15
58 lines (55 loc) · 2.31 KB
/
generate-command-reference.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Automatically generate command reference topics
on:
workflow_dispatch:
# Run daily after midnight UTC
schedule:
- cron: '22 1 * * *'
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: Set up Anbox Cloud
uses: canonical/anbox-cloud-github-action@a452c19155b194c53c0afa3bbe3057525ea17eee
with:
channel: ${{ steps.base_version.outputs.value }}/stable
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
# Remove existing files, generate AMC command reference
- name: Generate AMC command reference documentation
run: |
set -e
# Remove existing files, generate AMC command reference
rm -rf $AMC_COMMAND_REFERENCE_DIR/*
amc generate documentation -f markdown -d $AMC_COMMAND_REFERENCE_DIR
- name: Generate appliance command reference documentation
env:
SNAP_DOCS_DIR: "/var/snap/anbox-cloud-appliance/common/docs"
run: |
set -e
# Remove existing files, generate appliance command reference
rm -rf $APPLIANCE_COMMAND_REFERENCE_DIR/*
# For the appliance command, the files have to be generated inside the Snap
# and then copied to the desired directory because of Snap confinement
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: Create pull request
uses: canonical/create-pull-request@8f6ac18065716982f3970ef7d6d584bed1b4cbe3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Commit changes to command reference documentation"
branch-name: update-cmd-ref
title: Update command reference documentation
body: |
This updates the command reference topics for the AMC and Anbox Cloud Appliance.
You have to close and reopen the PR to trigger checks.
repository: canonical/anbox-cloud-docs
upsert: true
ignore-no-changes: true