Update Submodules #1259
This file contains 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 Submodules | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
push: | |
branches: | |
- main # Set a branch to deploy | |
schedule: | |
- cron: "0 4 * * *" # This line sets the action to run at 4 AM every day | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
# Fetch all history so we can push to the repo | |
fetch-depth: 0 | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- name: Checkout submodules | |
run: | | |
git submodule update --init --recursive | |
git config --file=.gitmodules submodule.public/static.branch main | |
git submodule update --remote public/static | |
- name: Commit and push changes | |
run: | | |
git config --global user.email "${{secrets.EMAIL}}" | |
git config --global user.name "${{secrets.NAME}}" | |
git commit -am "Update submodules" || echo "No changes to commit" | |
git push |