diff --git a/.github/workflows/release-update-website.yaml b/.github/workflows/release-update-website.yaml new file mode 100644 index 00000000000..ee555bf8141 --- /dev/null +++ b/.github/workflows/release-update-website.yaml @@ -0,0 +1,23 @@ +--- +name: Release + +on: + release: + types: [created] + +jobs: + update_website: + name: Update website + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + with: + repository: ivanvc/etcd-website + - env: + RELEASE_TAG: ${{ github.event.release.tag_name }} + run: | + minor="$(echo $RELEASE_TAG | cut -d. -f1-2)" + sed -i 's/git_version_tag:\sv\([0-9]\+\.\)\{2\}[0-9]\+/git_version_tag: '$RELEASE_TAG'/' "content/en/docs/$minor/_index.md" + git add "content/en/docs/$minor/_index.md" + git -c user.name="$GITHUB_ACTOR" -c user.email="$GITHUB_ACTOR@users.noreply.github.com" commit -m "[$minor] Update installation version to latest tag ($RELEASE_TAG)" + git push origin main