Skip to content

content-update

content-update #54

name: Update Content Submodule and Trigger Deployment
on:
repository_dispatch:
types:
- content-update
jobs:
update-content-submodule:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.CONTENT_UPDATE_PAT }}
persist-credentials: true
- name: Authorize Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "$GITHUB_ACTOR"
git config --global url."https://${{ secrets.CONTENT_UPDATE_PAT }}@github.com/".insteadOf "https://github.com/"
- name: Update content submodule
run: |
git submodule sync
git submodule update --remote --recursive
git add content
git commit -m "[github action] auto update content submodule" || echo "No changes to commit"
git push origin main