Skip to content

ci: Create workflow update-cli-docs.yml #6

ci: Create workflow update-cli-docs.yml

ci: Create workflow update-cli-docs.yml #6

Workflow file for this run

name: Update CLI Docs
on:
workflow_dispatch:
pull_request:
jobs:
update-cli-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: lacework/docs_lw
token: ${{ secrets.TOKEN }}
path: docs_lw
- name: Run update script
id: update
env:
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
working-directory: "docs_lw/docusaurus"
run: |
git remote set-url origin git@github.com:lacework/docs_lw.git
sudo apt-get update -y
sudo apt-get install gpg-agent -y
echo "$GPG_SECRET_KEY" | base64 --decode | gpg --import --no-tty --batch --yes
scripts/codefresh/update-cli-docs.sh
output=$(git rev-parse HEAD)
echo "git-sha=${output}" >> $GITHUB_OUTPUT
- name: Notify Slack for Approval
uses: slackapi/slack-github-action@v1.25.0
with:
payload: |
{
"text": ":docusaurus: Lacework CLI documentation update"
"attachments": [
{
"color": "#4db748",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":party-dinosaur:*Lacework CLI documentation update*\nNew documentation for the Lacework CLI has been generated and it is waiting for approval. :hand::skin-tone-4: @docs :party-dinosaur: :go__lw:\n*Github Workflow*: https://github.com/lacework/go-sdk/actions/runs/${{ github.run_id }}\n*GIT SHA*: ${{ steps.update.outputs.git-sha }}"
}
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
# TODO: add approval step
# - name: Deploy CLI docs
# working-directory: "docs_lw/docusaurus"
# run: |
# apt-get update
# apt-get install -y jq
# echo "GIT_SHA="${{ steps.update.outputs.git-sha }}
# scripts/codefresh/netlify-site-deploy.sh