Automatically redeploy the website whenever js-api-docs changes (#3178)

This commit is contained in:
Natalie Weizenbaum 2021-10-05 22:05:43 +00:00 committed by GitHub
parent 6fa1678aa2
commit 8e571ac5ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 0 deletions

View File

@ -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 }}"}

View File

@ -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 -