From e913ef32614677037467db32e3569d3da2841b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CA=88=E1=B5=83=E1=B5=A2?= Date: Fri, 23 Apr 2021 09:43:58 -0700 Subject: [PATCH] docs: add publish step (#14304) --- .../github-action-push-to-another-repository | 1 + .github/workflows/superset-docs.yml | 17 +++++++++++++++-- .gitmodules | 3 +++ docs/README.md | 6 ++++-- 4 files changed, 23 insertions(+), 4 deletions(-) create mode 160000 .github/actions/github-action-push-to-another-repository diff --git a/.github/actions/github-action-push-to-another-repository b/.github/actions/github-action-push-to-another-repository new file mode 160000 index 0000000000000..f30895310c20e --- /dev/null +++ b/.github/actions/github-action-push-to-another-repository @@ -0,0 +1 @@ +Subproject commit f30895310c20ef3d2569a5f690a80e56faf36c19 diff --git a/.github/workflows/superset-docs.yml b/.github/workflows/superset-docs.yml index 7dbe60d4f53ec..fe202767320a9 100644 --- a/.github/workflows/superset-docs.yml +++ b/.github/workflows/superset-docs.yml @@ -9,14 +9,15 @@ on: - "docs/**" jobs: - docs: - name: docs + build-deploy: + name: Build & Deploy runs-on: ubuntu-20.04 steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@v2 with: persist-credentials: false + submodules: recursive - name: npm install working-directory: ./docs run: | @@ -29,3 +30,15 @@ jobs: working-directory: ./docs run: | npm run build + - name: deploy docs + if: github.ref == 'refs/heads/master' + uses: ./.github/actions/github-action-push-to-another-repository + env: + API_TOKEN_GITHUB: ${{ secrets.SUPERSET_SITE_BUILD }} + with: + source-directory: './docs/public' + destination-github-username: 'apache' + destination-repository-name: 'superset-site' + target-branch: 'asf-site' + commit-message: "deploying docs: ${{ github.event.head_commit.message }} (apache/superset@${{ github.sha }})" + user-email: dev@superset.apache.org diff --git a/.gitmodules b/.gitmodules index 002a20709dc8e..26696552d1b70 100644 --- a/.gitmodules +++ b/.gitmodules @@ -36,3 +36,6 @@ [submodule ".github/actions/chart-releaser-action"] path = .github/actions/chart-releaser-action url = https://github.com/helm/chart-releaser-action +[submodule ".github/actions/github-action-push-to-another-repository"] + path = .github/actions/github-action-push-to-another-repository + url = git@github.com:cpina/github-action-push-to-another-repository.git diff --git a/docs/README.md b/docs/README.md index fb7636e330feb..c7074a68279e7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -23,7 +23,6 @@ Here's the source to the documentation hosted at The site runs on the Gatsby framework and uses docz for it's `Documentation` subsection. - ## Getting Started ```bash @@ -35,7 +34,10 @@ npm run start ## To Publish -To publish, the static site that Gatsby generates needs to be pushed +Github Actions CI automatically publishes the site after changes are +merged to master. + +To manually publish, the static site that Gatsby generates needs to be pushed to the `asf-site` branch on the [apache/superset-site](https://github.com/apache/superset-site/) repository. No need to PR here, simply `git push`.