diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71f6d5b7..4afc1e48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,3 +61,28 @@ jobs: with: {node-version: '${{ env.NODE_VERSION }}'} - run: npm ci - run: npm run typedoc + + # Whenever anything changes in js-api-docs, redeploy the website so it picks + # up those changes. + heroku: + name: Deploy sass-lang.com + runs-on: ubuntu-latest + needs: [static_analysis, js_api_mirroring, typedoc] + if: | + github.event_name == 'push' && + github.repository == 'sass/sass' && + github.ref == 'refs/heads/main' + + steps: + - uses: actions/checkout@v2 + with: {fetch-depth: 0} + + - name: Find changed files in js-api-doc + id: changed-files + uses: tj-actions/changed-files@b86b537e2b78397b630cfb1a8d0aec1e03379737 + with: {path: js-api-doc} + + - name: Deploy + if: steps.changed-files.outputs.any_changed == 'true' + run: tool/github-action/deploy-heroku.sh + env: {HEROKU_TOKEN: "${{ secrets.HEROKU_TOKEN }}"} diff --git a/tool/github-action/deploy-heroku.sh b/tool/github-action/deploy-heroku.sh new file mode 100755 index 00000000..5f413199 --- /dev/null +++ b/tool/github-action/deploy-heroku.sh @@ -0,0 +1,15 @@ +#!/bin/bash -e +# Copyright 2018 Google Inc. Use of this source code is governed by an MIT-style +# license that can be found in the LICENSE file or at +# https://opensource.org/licenses/MIT. + +curl https://kolkrabbi.heroku.com/apps/98fc74a8-ff56-4a21-85f6-7a1fc8ba95c9/github/push \ + -H "Content-Type: application/json" \ + -H "Accept: application/json, text/javascript, */*; q=0.01" \ + -H "Authorization: Bearer $HEROKU_TOKEN" \ + -H "accept-encoding: gzip, deflate, br" \ + -H "accept-language: en-US,en;q=0.9" \ + -H "origin: https://dashboard.heroku.com" \ + -H "referer: https://dashboard.heroku.com/" \ + -d '{"branch":"main"}' \ + --fail --output -