diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index b69ea43e9c..f16e684704 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -10,7 +10,7 @@ permissions: contents: write jobs: - website: + build: runs-on: ubuntu-latest steps: - name: Checkout code @@ -28,13 +28,23 @@ jobs: run: pipenv sync working-directory: docs - name: Update website - run: scripts/update-website - - name: Commit changes - run: | - if ! git diff --quiet; then - git add --all - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git commit -m 'Update website' - git push origin gh-pages - fi + run: pipenv run python3 build_website.py + working-directory: docs + - uses: actions/upload-pages-artifact@v3 + with: + path: docs/output/ + + deploy: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 + id: deployment diff --git a/scripts/update-website b/scripts/update-website deleted file mode 100755 index a99ffc18e1..0000000000 --- a/scripts/update-website +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# This script builds the website from the docs directory of -# the current branch and copies it over to the gh-pages -# branch. - -set -eux -shopt -s dotglob - -# build website -scriptdir=$(dirname "$0") -cd "$scriptdir"/../docs -rm -rf output -mkdir output -pipenv run python3 build_website.py -cd .. - -# copy to /tmp -tmpdir=$(mktemp -d -t jq.website.XXXXXXXXXX) -cp -r docs/output/* "$tmpdir" -cp .gitignore "$tmpdir" - -# copy to gh-pages -git checkout gh-pages -cp -r "$tmpdir"/* . -cp "$tmpdir"/.gitignore . - -# clean up -rm -rf "$tmpdir" -echo SUCCESS