From bb4c05af68d3a8925bb2061d2bf74d1f7f3ca60d Mon Sep 17 00:00:00 2001 From: josh-wong Date: Wed, 21 Feb 2024 15:39:43 +0900 Subject: [PATCH] Add workflow to update the `docs/latest` folder Add workflow to update the `docs/latest` folder with the latest version of docs. --- .github/workflows/update-latest-docs.yml | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/update-latest-docs.yml diff --git a/.github/workflows/update-latest-docs.yml b/.github/workflows/update-latest-docs.yml new file mode 100644 index 0000000..4924047 --- /dev/null +++ b/.github/workflows/update-latest-docs.yml @@ -0,0 +1,33 @@ +# Workflow for updating the `latest` folder to include the same content as the latest version of docs +name: 🔄 Update latest version of docs + +on: + push: + branches: + - "main" + paths: + - "3.12" # This path *must* match the folder name of the latest product release version. + # The following `workflow_dispatch` lines are for scheduling this workflow to reduce GitHub actions. We might want to consider scheduling docs to sync to the docs site repos in the future if we use too many action minutes in our monthly GitHub quota. + # workflow_dispatch: + # schedule: + # - cron: '0 1 * * 1,4' # Run at 1:00 AM Universal Time Coordinated (UTC) / 10:00 AM Japan Standard Time (JST) on Mondays and Thursdays. + +jobs: + update-latest-version-of-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Update the `latest` folder to include the same content as the latest version of docs + uses: dmnemec/copy_file_to_another_repo_action@main + env: + API_TOKEN_GITHUB: ${{ secrets.SYNC_DOCS_PAT }} + with: + source_file: "docs/3.12/" # This path *must* match the folder name of the latest version. + destination_repo: "scalar-labs/docs-scalardb" # Target repo + destination_folder: "docs/latest/" # Folder to sync to + destination_branch_create: "scalardb/update-docs-latest" + user_name: "josh-wong" + user_email: "joshua.wong@scalar-labs.com" + commit_message: "AUTO: Update the latest version of docs" + use_rsync: rsync -avh