Skip to content

Commit

Permalink
Merge pull request #166 from keirthana/automate-cmd-ref-pr
Browse files Browse the repository at this point in the history
Update workflow to create a PR instead of direct push
  • Loading branch information
keirthana authored Oct 8, 2024
2 parents c691e00 + a023732 commit 0977bd3
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/generate-command-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
id: base_version
run: |
echo "value=$(cat .base_version)" >> "$GITHUB_OUTPUT"
- name: Setup Anbox Cloud
- name: Set up Anbox Cloud
uses: canonical/anbox-cloud-github-action@39490d442cc0921fe614f7044b9f3dc8bd89725c
with:
channel: ${{ steps.base_version.outputs.value }}/stable
Expand All @@ -25,31 +25,30 @@ jobs:
- 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: 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
# 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: Commit changes
if: ${{ github.ref == 'refs/heads/main' }}
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
- name: Create pull request
uses: canonical/create-pull-request@3ad9cef62791c00f1c71d4aca902f4ea6abe0302
with:
default_author: github_actions
message: 'Generate appliance command reference documentation'
add: ${{ env.APPLIANCE_COMMAND_REFERENCE_DIR }}
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.
repository: canonical/anbox-cloud-docs
upsert: true
ignore-no-changes: true

0 comments on commit 0977bd3

Please sign in to comment.