2024-01-29 15:13:35 -05:00
|
|
|
name: Docs Deployment
|
2020-09-18 15:23:48 -04:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
2020-12-08 18:27:08 -05:00
|
|
|
- "docs/**"
|
2024-05-03 20:23:42 -04:00
|
|
|
- "README.md"
|
2024-01-23 23:30:53 -05:00
|
|
|
branches:
|
2024-01-29 15:13:35 -05:00
|
|
|
- "master"
|
2020-09-18 15:23:48 -04:00
|
|
|
|
2024-04-24 11:40:24 -04:00
|
|
|
workflow_dispatch: {}
|
|
|
|
|
2020-09-18 15:23:48 -04:00
|
|
|
jobs:
|
2023-04-14 11:23:00 -04:00
|
|
|
config:
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
outputs:
|
|
|
|
has-secrets: ${{ steps.check.outputs.has-secrets }}
|
|
|
|
steps:
|
|
|
|
- name: "Check for secrets"
|
|
|
|
id: check
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
if [ -n "${{ (secrets.SUPERSET_SITE_BUILD != '' && secrets.SUPERSET_SITE_BUILD != '') || '' }}" ]; then
|
|
|
|
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
|
|
|
|
fi
|
|
|
|
|
2021-04-23 12:43:58 -04:00
|
|
|
build-deploy:
|
2023-04-14 11:23:00 -04:00
|
|
|
needs: config
|
|
|
|
if: needs.config.outputs.has-secrets
|
2021-04-23 12:43:58 -04:00
|
|
|
name: Build & Deploy
|
2024-01-29 18:53:38 -05:00
|
|
|
runs-on: "ubuntu-latest"
|
2020-09-18 15:23:48 -04:00
|
|
|
steps:
|
2021-01-24 02:10:16 -05:00
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2024-02-01 13:56:33 -05:00
|
|
|
uses: actions/checkout@v4
|
2021-01-24 02:10:16 -05:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2021-04-23 12:43:58 -04:00
|
|
|
submodules: recursive
|
2024-04-02 18:48:08 -04:00
|
|
|
- name: Set up Node.js 18
|
2024-02-01 10:06:48 -05:00
|
|
|
uses: actions/setup-node@v4
|
2024-01-29 18:53:38 -05:00
|
|
|
with:
|
2024-04-02 18:48:08 -04:00
|
|
|
node-version: '18'
|
2024-04-23 19:12:42 -04:00
|
|
|
- name: Setup Python
|
|
|
|
uses: ./.github/actions/setup-backend/
|
2024-04-24 11:40:24 -04:00
|
|
|
- uses: actions/setup-java@v4
|
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: '21'
|
|
|
|
- name: Install Graphviz
|
|
|
|
run: sudo apt-get install -y graphviz
|
2024-04-23 19:12:42 -04:00
|
|
|
- name: Compute Entity Relationship diagram (ERD)
|
2024-04-24 11:40:24 -04:00
|
|
|
env:
|
|
|
|
SUPERSET_SECRET_KEY: not-a-secret
|
2024-04-23 19:12:42 -04:00
|
|
|
run: |
|
2024-04-24 11:40:24 -04:00
|
|
|
python scripts/erd/erd.py
|
2024-04-23 19:12:42 -04:00
|
|
|
curl -L http://sourceforge.net/projects/plantuml/files/1.2023.7/plantuml.1.2023.7.jar/download > ~/plantuml.jar
|
2024-04-24 11:40:24 -04:00
|
|
|
java -jar ~/plantuml.jar -v -tsvg -r -o "${{ github.workspace }}/docs/static/img/" "${{ github.workspace }}/scripts/erd/erd.puml"
|
2022-02-02 16:02:51 -05:00
|
|
|
- name: yarn install
|
2024-04-24 11:40:24 -04:00
|
|
|
working-directory: docs
|
2020-12-08 18:27:08 -05:00
|
|
|
run: |
|
2022-02-03 13:35:08 -05:00
|
|
|
yarn install --check-cache
|
2022-02-02 16:02:51 -05:00
|
|
|
- name: yarn build
|
2024-04-24 11:40:24 -04:00
|
|
|
working-directory: docs
|
2020-12-08 18:27:08 -05:00
|
|
|
run: |
|
2022-02-02 16:02:51 -05:00
|
|
|
yarn build
|
2021-04-23 12:43:58 -04:00
|
|
|
- name: deploy docs
|
|
|
|
uses: ./.github/actions/github-action-push-to-another-repository
|
|
|
|
env:
|
|
|
|
API_TOKEN_GITHUB: ${{ secrets.SUPERSET_SITE_BUILD }}
|
|
|
|
with:
|
2024-01-29 15:13:35 -05:00
|
|
|
source-directory: "./docs/build"
|
|
|
|
destination-github-username: "apache"
|
|
|
|
destination-repository-name: "superset-site"
|
|
|
|
target-branch: "asf-site"
|
2021-04-23 12:43:58 -04:00
|
|
|
commit-message: "deploying docs: ${{ github.event.head_commit.message }} (apache/superset@${{ github.sha }})"
|
|
|
|
user-email: dev@superset.apache.org
|