forked from docker/docs
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (77 loc) · 2.49 KB
/
sync-cli-docs.yml
File metadata and controls
83 lines (77 loc) · 2.49 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
name: sync-cli-docs
on:
schedule:
# Run daily at 02:00 UTC
- cron: '0 2 * * *'
workflow_dispatch:
inputs:
version:
description: "(optional) Docker CLI version - defaults to docker_ce_version in hugo.yaml"
required: false
default: ""
pull_request:
paths:
- '.github/workflows/sync-cli-docs.yml'
- 'hack/sync-cli-docs.sh'
permissions:
contents: write
pull-requests: write
jobs:
sync-cli-docs:
runs-on: ubuntu-24.04
steps:
-
name: Checkout docs repo
uses: actions/checkout@v5
with:
fetch-depth: 0
-
name: Get version from hugo.yaml
id: get-version
run: |
if [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
else
VERSION=$(grep "docker_ce_version:" hugo.yaml | awk '{print $2}' | tr -d '"')
fi
# TODO(vvoland): Remove this after 29.2.0 is released
# VERSION=v${VERSION}
VERSION=60f06cb2df3df36ddfb531c1dae8c6fa96e5f9e7
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Docker CLI version: **$VERSION**" | tee -a "$GITHUB_STEP_SUMMARY"
-
name: Checkout docker/cli repo
uses: actions/checkout@v5
with:
repository: docker/cli
path: cli-source
ref: ${{ steps.get-version.outputs.version }}
fetch-depth: 0
-
name: Run sync script
id: sync
run: ./hack/sync-cli-docs.sh HEAD cli-source
-
name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7
with:
branch: bot/sync-cli-docs-${{ steps.get-version.outputs.version }}
base: main
delete-branch: true
add-paths: |
data/engine-cli/*.yaml
commit-message: "cli: sync docs with docker/cli ${{ steps.sync.outputs.git_ref }}"
title: "cli: sync docs with docker/cli"
body: |
## Summary
Automated sync of CLI documentation from docker/cli repository.
**CLI version**: ${{ steps.get-version.outputs.version }}
**Git ref**: ${{ steps.sync.outputs.git_ref }}
reviewers: "@engine"
-
name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"