-
Notifications
You must be signed in to change notification settings - Fork 495
Expand file tree
/
Copy pathrelease_update_docs_px_dev.yaml
More file actions
96 lines (95 loc) · 3.33 KB
/
release_update_docs_px_dev.yaml
File metadata and controls
96 lines (95 loc) · 3.33 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
name: update-docs-px-dev-on-release
on:
release:
types: [released]
permissions:
contents: read
jobs:
get-dev-image:
if: contains(github.ref, 'release/vizier/')
uses: ./.github/workflows/get_image.yaml
with:
image-base-name: "dev_image_with_extras"
generate-docs:
needs: get-dev-image
runs-on: ubuntu-latest-8-cores
container:
image: ${{ needs.get-dev-image.outputs.image-with-tag }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Add pwd to git safe dir
run: git config --global --add safe.directory `pwd`
- name: get dev bazel config
uses: ./.github/actions/bazelrc
with:
dev: 'true'
BB_API_KEY: ${{ secrets.BB_IO_API_KEY }}
- name: Generate documentation files
shell: bash
run: |
bazel run src/carnot/docstring:docstring -- \
--output_json=$(pwd)/pxl_documentation.json
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: pxl_documentation
path: pxl_documentation.json
if-no-files-found: error
update-docs-px-dev:
needs: [get-dev-image, generate-docs]
runs-on: ubuntu-latest
steps:
- name: Clone docs.px.dev repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: pixie-io/docs.px.dev
ref: main
- name: Import GPG key
shell: bash
env:
BUILDBOT_GPG_KEY_B64: ${{ secrets.BUILDBOT_GPG_KEY_B64 }}
BUILDBOT_GPG_KEY_ID: ${{ secrets.BUILDBOT_GPG_KEY_ID }}
run: |
echo "${BUILDBOT_GPG_KEY_B64}" | base64 --decode | gpg --no-tty --batch --import
git config --global user.signingkey "${BUILDBOT_GPG_KEY_ID}"
git config --global commit.gpgsign true
- name: Import SSH key
shell: bash
env:
BUILDBOT_SSH_KEY_B64: ${{ secrets.BUILDBOT_SSH_KEY_B64 }}
run: |
echo "${BUILDBOT_SSH_KEY_B64}" | base64 --decode > /tmp/ssh.key
chmod 600 /tmp/ssh.key
- name: Setup git
shell: bash
env:
GIT_SSH_COMMAND: "ssh -i /tmp/ssh.key"
run: |
git config --global user.name 'pixie-io-buildbot'
git config --global user.email 'build@pixielabs.ai'
git remote add fork git@github.com:pixie-io-buildbot/docs.px.dev.git
- uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
with:
name: pxl_documentation
path: external/
- name: Create PR
shell: bash
env:
GH_TOKEN: ${{ secrets.BUILDBOT_GH_API_TOKEN }}
GIT_SSH_COMMAND: "ssh -i /tmp/ssh.key"
run: |
if [[ $(git status --porcelain=v1 | wc -l) -eq 0 ]]; then
echo "No updates to the documentation detected, exiting."
exit 0
fi
DATE=$(date +%Y-%m-%d)
PR_TITLE="[bot] Update pxl script documentation ${DATE}"
export BRANCH="update-docs-px-dev-documentation-${DATE}"
git checkout -b "${BRANCH}"
git add external
git commit -s -m "${PR_TITLE}"
git push -f fork "${BRANCH}"
gh pr create --repo pixie-io/docs.px.dev \
--head "pixie-io-buildbot:${BRANCH}" \
--body "This change updates the generated documentation against the latest pixie repo changes." \
--title "${PR_TITLE}"