Skip to content

Sync Spring Docs #14167

Sync Spring Docs

Sync Spring Docs #14167

name: Sync Spring Docs
on:
schedule:
- cron: '*/20 * * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Sync Spring Docs
runs-on: [usw1, Linux ]
env:
ARTIFACTORY_HOST: ${{ secrets.COMMERCIAL_ARTIFACTORY_HOST }}
ARTIFACTORY_USERNAME: ${{ secrets.COMMERCIAL_ANNOTATE_ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.COMMERCIAL_ANNOTATE_ARTIFACTORY_PASSWORD }}
steps:
- uses: actions/checkout@v3
- name: Download Spring Docs from Artifactory
run: ./download-spring-docs/src/action.sh --artifactory-host "$ARTIFACTORY_HOST" --artifactory-username "$ARTIFACTORY_USERNAME" --artifactory-password "$ARTIFACTORY_PASSWORD" --docs-base-dir docs
# We are not using analytics so we don't need to do this
# - name: Inject OneTrust
# run: ./inject-onetrust/src/action.sh --docs-base-dir docs
- name: 'Authenticate to ${{ vars.COMMERCIAL_DOCS_HOST }}'
uses: 'google-github-actions/[email protected]'
with:
credentials_json: '${{ secrets.COMMERCIAL_DOCS_GCP_BUCKET_JSON }}'
- name: Upload to ${{ secrets.COMMERCIAL_DOCS_HOST }}
id: 'upload-folder'
uses: 'google-github-actions/[email protected]'
with:
path: 'docs'
destination: ${{ secrets.COMMERCIAL_DOCS_HOST }}
parent: false
# https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
# Scheduled workflows of public repos with no activity for 60 days will be disabled
workflow-keepalive:
name: Keep Scheduled Job Alive
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Re-enable workflow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: sh
run: |
case "${GITHUB_WORKFLOW_REF:?}" in
"${GITHUB_REPOSITORY:?}"/.github/workflows/*.y*ml@*) ;;
*) false ;;
esac
workflow="${GITHUB_WORKFLOW_REF%%@*}"
workflow="${workflow#${GITHUB_REPOSITORY}/.github/workflows/}"
gh api -X PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow}/enable"