content-update #63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |