update-contents #89
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "[email protected]" | |
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 }} |