]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Trigger docs update to the website build workflow on GitHub Action
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 17 Jun 2021 12:31:32 +0000 (13:31 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 17 Jun 2021 12:31:32 +0000 (13:31 +0100)
.github/workflows/docs.yml
tools/travis_update_docs.sh [deleted file]

index 2478b483b7b4d12a6c4fd44c6293ec17f9289ad6..72f7a068ce8f9613631e0c750ecb734532560e19 100644 (file)
@@ -3,16 +3,16 @@ name: Build documentation
 on:
   push:
     branches:
+      # This should match the DOC3_BRANCH value in the psycopg-website Makefile
       - master
 
 jobs:
   docs:
-    runs-on: ubuntu-20.04
-
+    runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
       - name: Trigger docs build
-        run: ./tools/travis_update_docs.sh
-        env:
-          TRAVIS_BRANCH: master
-          TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }}
+        uses: peter-evans/repository-dispatch@v1
+        with:
+          repository: psycopg/psycopg-website
+          event-type: psycopg3-commit
+          token: ${{ secrets.ACCESS_TOKEN }}
diff --git a/tools/travis_update_docs.sh b/tools/travis_update_docs.sh
deleted file mode 100755 (executable)
index 18a1073..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-# Trigger a rebuild of the psycopg.org website to update the documentation.
-# The script is meant to run by Travis CI.
-
-set -euo pipefail
-
-# The travis token can be set at https://travis-ci.com/psycopg/psycopg3/settings
-# and can be set on a selected branch only (which should match the DOC3_BRANCH
-# in the psycopg-website Makefile, or it won't refresh a thing).
-if [ -z "${TRAVIS_TOKEN:-}" ]; then
-    echo "skipping docs update: travis token not set" >&2
-    exit 0
-fi
-
-echo "triggering psycopg-website rebuild" >&2
-curl -s -X POST \
-    -H "Content-Type: application/json" \
-    -H "Accept: application/json" \
-    -H "Travis-API-Version: 3" \
-    -H "Authorization: token ${TRAVIS_TOKEN}" \
-    -d "{\"request\": {\"branch\": \"${TRAVIS_BRANCH}\"}}" \
-    https://api.travis-ci.com/repo/psycopg%2Fpsycopg-website/requests