diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98d781a..ca0cd24 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,11 +15,11 @@ jobs: steps: # Checkout and setup - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - submodules: 'recursive' + submodules: recursive - name: Setup - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 # Install and build diff --git a/.github/workflows/update-submodule.yml b/.github/workflows/update-submodule.yml new file mode 100644 index 0000000..7a4a04b --- /dev/null +++ b/.github/workflows/update-submodule.yml @@ -0,0 +1,21 @@ +name: Update submodule + +on: + repository_dispatch: + types: + - update-submodule +jobs: + update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.PAT }} + submodules: recursive + - name: Update module + run: | + git submodule update --init --recursive --checkout -f --remote -- "${{github.event.client_payload.module}}" + git config --global user.name "GitHub Action" + git config --global user.email "noreply@github.com" + git commit -am "deploy: ${{github.event.client_payload.module}} - ${{github.event.client_payload.sha}}" + git push