-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (78 loc) · 2.59 KB
/
auto-update-content.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
68
69
70
71
72
73
74
75
76
77
78
79
name: Update content
on:
repository_dispatch:
types: [update-contents]
jobs:
update-content:
name: Update Content
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set Git Config and checkout main branch
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git config --global user.name "vdaas-ci"
git config --global user.email "ci@vdaas.org"
git remote set-url origin "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git submodule update --init --recursive
git checkout main
git fetch --prune
git pull origin main
env:
GITHUB_USER: ${{ secrets.DISPATCH_USER }}
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
- name: Fetch Go version
id: go_version
shell: bash
run: |
GO_VERSION=$(make version/go)
echo "version=${GO_VERSION}" >> $GITHUB_OUTPUT
- uses: actions/setup-go@v4
with:
go-version: ${{ steps.go_version.outputs.version }}
- name: Check Go version
shell: bash
run:
go version
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: latest
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
- uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Install deps
run: |
make init
- name: Update root content
run: |
make all
- name: Update latest version content
run: |
make TARGET_VER=$(make version/latest) all
- name: Update support version content
run: |
make TARGET_VER=$(make version/support) all
- name: create pull request
run: |
TS=$(date +%s)
BRANCH_NAME="release/update-contents/${TS}"
git checkout main
git checkout -b ${BRANCH_NAME}
git add .
git commit -S -m ":pencil: Update contents by GitHub Actions"
git push origin ${BRANCH_NAME}
gh pr create --base main \
--title "Release update contents" \
--body ":pencil: Release update contents by GitHub Actions"
env:
GITHUB_USER: ${{ secrets.DISPATCH_USER }}
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }}