Skip to content

building docs

building docs #310

Workflow file for this run

name: build-docs-actions
run-name: building docs
on:
push:
branches:
- main
jobs:
find-provider-on-change:
runs-on: ubuntu-latest
outputs:
providers: ${{ steps.provider-to-deploy.outputs.provider_to_deploy }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
- name: find updated providers
id: provider-to-deploy
uses: actions/[email protected]
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
with:
script: |
const script = require('./ci-scripts/get-providers-to-deploy.js')
await script({github, context, core})
- name: show updated providers
env:
PROVIDERS_TO_DEPLOY: ${{ steps.provider-to-deploy.outputs.provider_to_deploy }}
run: |
echo "found updated providers -> ${PROVIDERS_TO_DEPLOY}"
echo "PROVIDERS_TO_DEPLOY=${PROVIDERS_TO_DEPLOY}" >> $GITHUB_ENV
- name: prepare Slack message
env:
PROVIDERS_TO_DEPLOY: ${{ env.PROVIDERS_TO_DEPLOY }}
run: |
node ci-scripts/format-slack-message-payload.js "Provider doc builds starting for *${PROVIDERS_TO_DEPLOY}*" ":page_with_curl:"
- name: Send Slack message
id: slack
uses: slackapi/[email protected]
with:
payload-file-path: slack-message.json
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
deploy-to-netlify:
runs-on: ubuntu-latest
needs: find-provider-on-change
strategy:
fail-fast: false
matrix:
provider: ${{fromJson(needs.find-provider-on-change.outputs.providers)}}
steps:
- name: Checkout
uses: actions/[email protected]
- name: install
run:
npm install
- name: Build
env:
NODE_OPTIONS: "--max_old_space_size=24576"
run: npm run build:${{matrix.provider}}
- name: add redirects to root site
env:
PROVIDER: ${{ matrix.provider }}
run: |
if [ $PROVIDER == "root" ]; then
echo "adding vanity url redirects to _redirects file.."
touch ./build/_redirects
array=( aws azure azure-extras azure-isv azure-stack digitalocean firebase github google googleadmin k8s linode netlify okta sumologic vercel godaddy pagerduty homebrew datadog )
for i in "${array[@]}"
do
echo "adding redirects for $i"
echo "/${i} https://${i}.stackql.io/providers/${i}/ 302" >> ./build/_redirects
echo "/providers/${i} https://${i}.stackql.io/providers/${i}/ 302" >> ./build/_redirects
done
else
echo "skipping redirects for ${PROVIDER}"
fi
- name: Publish
uses: netlify/actions/cli@master
env:
NETLIFY_SITE_ID: ${{ secrets[format('NETLIFY_SITE_ID_{0}', matrix.provider)] }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
with:
args: deploy --prod --dir ./build --message "Deploy from Github Action"
- name: prepare Slack message
env:
PROVIDER: ${{ matrix.provider }}
run: |
node ci-scripts/format-slack-message-payload.js "Deployment finished for *${PROVIDER}*" ":rocket:"
- name: Send Slack message
id: slack
uses: slackapi/[email protected]
with:
payload-file-path: slack-message.json
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK