-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 1.29 KB
/
update_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
name: Update Documentation
on:
pull_request:
branches:
- main
jobs:
update_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22.2'
- name: Run go generate
run: go generate ./...
- name: Execute build_media_map script
run: chmod +x ./scripts/build_media_map.sh && ./scripts/build_media_map.sh
id: script_output
- name: Append output to docs/index.md
run: |
echo -e "\n# epic Provider\n$(cat docs/index.md)" > docs/index.md
echo "${{ steps.script_output.outputs.result }}" >> docs/index.md
- uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
- name: Git push docs/index.md with media type and title mapping
run: |
git config --global user.name "${{ vars.TF_THESUDO_CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ vars.TF_THESUDO_CI_COMMIT_EMAIL }}"
git add .
git commit -a -m "Update docs/index.md"
git push "https://${{ vars.TF_THESUDO_CI_COMMIT_AUTHOR }}:${{ secrets.TF_THESUDO_COMMIT_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"