forked from newrelic/node-newrelic
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (63 loc) · 2.05 KB
/
post-release.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
61
62
63
64
65
66
67
name: Agent Post Release
on:
workflow_dispatch:
inputs:
repo_target:
description: Generate the docs for the local repo, the docs repo, or both.
required: true
type: choice
default: both
options:
- local
- docs
- both
workflow_run:
workflows: ["Create Release"]
types:
- completed
jobs:
local:
runs-on: ubuntu-latest
if:
(github.event.workflow_run && github.event.workflow_run.conclusion == 'success') ||
(github.event_name == 'workflow_dispatch' &&
(inputs.repo_target == 'local' || inputs.repo_target == 'both'))
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm install
- run: |
git config user.name ${GITHUB_ACTOR}
git config user.email gh-actions-${GITHUB_ACTOR}@github.com
- id: get_tag
run: echo "latest_tag=$(cat package.json | jq .version)" >> $GITHUB_OUTPUT
- run: npm run publish-docs
docs:
runs-on: ubuntu-latest
if:
(github.event.workflow_run && github.event.workflow_run.conclusion == 'success') ||
(github.event_name == 'workflow_dispatch' &&
(inputs.repo_target == 'docs' || inputs.repo_target == 'both'))
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm install
- run: |
git config user.name ${GITHUB_ACTOR}
git config user.email gh-actions-${GITHUB_ACTOR}@github.com
- id: get_tag
run: echo "latest_tag=$(cat package.json | jq .version)" >> $GITHUB_OUTPUT
- name: Create Docs Website PR
run: node ./bin/create-docs-pr.js --tag v${{ steps.get_tag.outputs.latest_tag }}
env:
GITHUB_TOKEN: ${{ secrets.NODE_AGENT_GH_TOKEN }}
GITHUB_USER: ${{ vars.NODE_AGENT_CI_USER_NAME }}
GITHUB_EMAIL: ${{ vars.NODE_AGENT_CI_USER_EMAIL }}