diff --git a/.github/workflows/metadata_updater.yml b/.github/workflows/metadata_updater.yml new file mode 100644 index 0000000..128eae7 --- /dev/null +++ b/.github/workflows/metadata_updater.yml @@ -0,0 +1,45 @@ +name: Metadata updater + +on: + push: + workflow_dispatch: + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f doc/assets/workflows/requirements.txt ]; then pip install -r doc/assets/workflows/requirements.txt; fi + + - name: Update metadata + env: + gh_repo: ${{ github.event.repository.name }} + gh_url: ${{ github.server_url }}/${{ github.repository }} + gh_branch: ${{ github.head_ref || github.ref_name }} + gh_description: ${{ github.event.repository.name }} + gh_repository: ${{ github.repository }} + gh_token: ${{ secrets.GITHUB_TOKEN }} + run: | + python3 doc/assets/workflows/update_metadata.py + python3 doc/assets/workflows/update_kitspace.py + + - uses: stefanzweifel/git-auto-commit-action@v4.16.0 + with: + commit_message: Update metadata files + commit_options: '-a' diff --git a/.github/workflows/update_actions.yml b/.github/workflows/update_actions.yml new file mode 100644 index 0000000..e97addb --- /dev/null +++ b/.github/workflows/update_actions.yml @@ -0,0 +1,41 @@ +name: Update actions and assets repository +on: + schedule: + - cron: "0 */24 * * *" + + push: + paths: + - '.gitmodules' + + workflow_dispatch: + +jobs: + Aktualizace: + name: Update repository actions and other tools + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + token: ${{ secrets.pat }} + ref: ${{ github.head_ref }} + + - name: Update submodules + run: | + git -C doc/assets config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' + git submodule sync doc/assets + git submodule update --init --remote doc/assets + + - name: Update submodules + run: | + git submodule update --remote doc/assets/ + + - name: Zaktualizovat skripty + run: | + cd doc/assets/workflows/ && ./copy_workflow_to_repo.sh && cd ${GITHUB_WORKSPACE} + + - uses: stefanzweifel/git-auto-commit-action@v4.16.0 + with: + commit_message: Update workflow files + add_options: '-A' + commit_options: '-a' diff --git a/doc/assets b/doc/assets index b54095f..2e5044a 160000 --- a/doc/assets +++ b/doc/assets @@ -1 +1 @@ -Subproject commit b54095f70113bb442a625587377b4523e3c56c42 +Subproject commit 2e5044a1a0bfdf4cc8a73491b5729c35a2391767