From b508341cbdc30ed8684edf1e0ed3b7456abe59b8 Mon Sep 17 00:00:00 2001 From: "Valentin D. Pinkman" Date: Fri, 10 Jan 2025 16:29:44 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20(doc):=20Sync=20doc=20with=20led?= =?UTF-8?q?gerhq/developer-portal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sync_doc.yml | 61 ++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/sync_doc.yml diff --git a/.github/workflows/sync_doc.yml b/.github/workflows/sync_doc.yml new file mode 100644 index 000000000..4c170bb0c --- /dev/null +++ b/.github/workflows/sync_doc.yml @@ -0,0 +1,61 @@ +name: "[Automation] Sync Doc" +on: + workflow_dispatch: + inputs: + ref: + description: The base branch to publish a snapshot release from + required: false + default: "chore/no-issue-sync-doc-to-portal" + push: + branches: + - chore/no-issue-sync-doc-to-portal + paths: + - "apps/docs/pages/docs/*" + +jobs: + sync_doc: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.ref || github.event.ref }} + path: ldmk + sparse-checkout: | + apps/docs/pages/docs + + - uses: actions/checkout@v4 + with: + repository: ledgerhq/developer-portal + path: portal + + - name: Set up Git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + + + - name: Copy files + run: | + rm -rf portal/pages/docs/device-interaction + mkdir -p portal/pages/docs/device-interaction + cp -r ldmk/apps/docs/pages/docs/* portal/pages/docs/device-interaction + + + - name: Set branch name in outputs + id: branch-name + run: | + branch_name="sync-dmk-doc-$(date +%Y-%m-%d-%H-%M)" + echo "BRANCH_NAME=$branch_name" >> $GITHUB_OUTPUT + + - name: Commit changes + run: | + cd portal + # add timestamp to commit message + git checkout -b ${{ steps.branch-name.outputs.BRANCH_NAME }} + git add pages/docs/device-interaction + git commit -m "doc: add new changes from device management kit to portal" + + - name: Create pull request + run: | + cd portal + gh pr create --title "doc: add new changes from device management kit to portal" --base develop --head ${{ steps.branch-name.outputs.BRANCH_NAME }}