Skip to content

chore: refactor the github actions has-secrets logic #4621

chore: refactor the github actions has-secrets logic

chore: refactor the github actions has-secrets logic #4621

Workflow file for this run

name: Docs
on:
push:
paths:
- "docs/**"
branches:
- 'master'
pull_request:
paths:
- "docs/**"
types: [synchronize, opened, reopened, ready_for_review]
jobs:
check-secrets:
uses: ./.github/workflows/check-secrets.yml
with:
secret_name: 'SUPERSET_SITE_BUILD'
secrets: inherit
build-deploy:
needs: check-secrets
if: needs.check-secrets.outputs.has-secrets == 'true'
name: Build & Deploy
runs-on: ubuntu-20.04
defaults:
run:
working-directory: docs
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v3
with:
persist-credentials: false
submodules: recursive
- name: yarn install
run: |
yarn install --check-cache
- name: yarn build
run: |
yarn 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/build'
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