Update go updates #1144
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: Build & Deploy Website | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches-ignore: | |
- 'gh-pages' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ vars.ARCALOT_GO_VERSION }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ vars.ARCALOT_PYTHON_VERSION }} | |
architecture: x64 | |
- name: Install requirements.txt | |
run: pip install -r requirements.txt | |
- name: Docsgen | |
run: | | |
cd docsgen | |
go build -o ../arcaflow-docsgen . | |
chmod +x ../arcaflow-docsgen | |
cd ../docs/arcaflow | |
../../arcaflow-docsgen | |
- name: Build site | |
run: mkdocs build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: site | |
path: site/* | |
if-no-files-found: error | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
contents: write | |
pages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: dist | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: site | |
path: artifacts | |
- name: Deploy | |
run: | | |
set -euo pipefail | |
rsync -az --exclude=.git --delete ./artifacts/ ./dist/ | |
cd dist | |
git config user.name "Arcabot of Arcalot" | |
git config user.email [email protected] | |
git add . | |
if ! git diff-index --quiet HEAD --; then | |
git commit -m "Website publish" | |
git push --set-upstream --force origin gh-pages | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |