From 02a043356547205da2e6226dce9264afba31dde8 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 28 Jul 2024 16:25:15 +0200 Subject: [PATCH] Add update_schema action --- .github/workflows/update_schema.yml | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/update_schema.yml diff --git a/.github/workflows/update_schema.yml b/.github/workflows/update_schema.yml new file mode 100644 index 0000000..65be590 --- /dev/null +++ b/.github/workflows/update_schema.yml @@ -0,0 +1,56 @@ +name: Deploy schema to Pages + +on: + workflow_dispatch: + inputs: + branch: + type: choice + description: 'Branch to deploy' + required: true + default: 'develop' + options: + - 'develop' + - 'stable' + +permissions: + contents: write + +concurrency: + group: "update schema" + cancel-in-progress: false + + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: 'config_schema' + + - name: Checkout freqtrade repo + uses: actions/checkout@v4 + with: + repository: freqtrade/freqtrade + path: 'freqtrade' + ref: "${{ github.event.inputs.branch }}" + + + - name: Copy schema.json file from freqtrade repo to config_schema + if : ${{ github.event.inputs.branch == 'stable' }} + run: | + cp freqtrade/build_helpers/schema.json config_schema/schema/schema.json + + - name: Copy schema.json file from freqtrade repo to config_schema + if : ${{ github.event.inputs.branch == 'develop' }} + run: | + cp freqtrade/build_helpers/schema.json config_schema/schema/schema_dev.json + + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Update schema.json file ${{ github.event.inputs.branch }}" + commit_user_name: Freqtrade Bot + commit_user_email: freqtrade@protonmail.com + file_pattern: 'schema/.*json' + repository: "config_schema"