.github: install exact golang version if necessary. #203
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: Publish documentation | |
on: | |
push: | |
branches: | |
- main | |
- release-* | |
tags: | |
- v* | |
env: | |
GO_VERSION: "1.22.1" | |
concurrency: | |
group: gh-pages | |
jobs: | |
update-gh-pages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install exact golang version from release tarball if needed | |
run: | | |
go_version=$(go version | sed 's/^go version //;s/ .*$//') | |
if [ "$go_version" != "${{ env.GO_VERSION }} " ]; then | |
wget https://go.dev/dl/go${{ env.GO_VERSION }}.linux-amd64.tar.gz | |
sudo tar -C /usr/local -xzf go${{ env.GO_VERSION }}.linux-amd64.tar.gz | |
echo "/usr/local/go/bin" >> $GITHUB_PATH | |
fi | |
- name: Install build dependencies | |
run: | | |
pip3 install --user -r docs/requirements.txt | |
echo "`python3 -m site --user-base`/bin" >> $GITHUB_PATH | |
- name: Add docs from this revision to gh-pages | |
run: | | |
git config user.name "Github" | |
git config user.email "[email protected]" | |
./scripts/build/update-gh-pages.sh | |
- name: Publish/push to gh-pages | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git gh-pages |