-
Notifications
You must be signed in to change notification settings - Fork 27
60 lines (53 loc) · 1.91 KB
/
docs.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
59
60
name: Generate feature docs
concurrency:
group: generate-feature-docs-on-${{ github.event_name }}-from-${{ github.ref_name }}
cancel-in-progress: true
on:
push:
branches:
- branch-*
jobs:
docs:
if: github.repository == 'rapidsai/devcontainers'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Copy common scripts into features
uses: ./.github/actions/copy-common-scripts
- name: Install devcontainers CLI
uses: ./.github/actions/install-devcontainers-cli
- name: Generate feature docs
uses: devcontainers/action@v1
with:
generate-docs: "true"
publish-features: "false"
disable-repo-tagging: "true"
base-path-to-features: "./features/src"
features-namespace: "${{ github.repository }}/features"
- name: Create PR for Documentation
shell: bash -e {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Configure git
git config --global user.email github-actions@github.com;
git config --global user.name github-actions;
git config pull.rebase false;
# Get name of target branch
base="$(git branch --show-current)";
# Make branch for docs update
branch=automated-documentation-update-$GITHUB_RUN_ID;
git checkout -b $branch;
message='Automated documentation update';
# Add / update and commit
git add */**/README.md;
git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true;
# Push updates
if [ "$NO_UPDATES" != "true" ] ; then
git push origin "$branch";
gh pr create --base "$base" --title "$message" --body "$message";
fi