-
-
Notifications
You must be signed in to change notification settings - Fork 137
Migrating Hugo modules and Discourse data updates worflows #969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a692af5
Automate Hugo modules and Discourse data updates
MuhammadAashirAslam 9acc478
Merge branch 'hugo' into hugo-automation
MakisH e1c2afc
Rename update-hugo-modules.yml to update-submodules.yml
MuhammadAashirAslam 3bbea9f
Add view threshold and excerpt caching to Discourse fetch scripts
MuhammadAashirAslam 429e6df
Merge branch 'hugo' into hugo-automation
MakisH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
|
MakisH marked this conversation as resolved.
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,39 +1,67 @@ | ||
| name: Update submodules | ||
| name: Update Hugo modules | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "0 0 * * *" | ||
| - cron: "5 0 * * *" | ||
|
|
||
| concurrency: | ||
| group: update-hugo-modules | ||
| cancel-in-progress: false | ||
|
|
||
| env: | ||
| GO_VERSION: "1.26.3" | ||
| HUGO_VERSION: "0.163.3" | ||
| PYTHON_VERSION: "3.14" | ||
|
|
||
| jobs: | ||
| update: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| permissions: | ||
| contents: 'write' | ||
| outputs: | ||
| success: ${{ steps.commit.outputs.outcome == 'success' }} | ||
| contents: write | ||
|
|
||
| steps: | ||
| - uses: actions/create-github-app-token@v3 | ||
| id: app-token | ||
| with: | ||
| client-id: ${{ vars.WEBSITE_UPDATER_CLIENT_ID }} | ||
| private-key: ${{ secrets.WEBSITE_UPDATER_KEY }} | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: false | ||
| lfs: true | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| - name: Update submodules | ||
| run: git submodule update --init --remote --force | ||
| - name: Commit update | ||
| id: commit | ||
| continue-on-error: true | ||
| lfs: false | ||
| token: ${{ secrets.WORKFLOW_DISPATCH_TOKEN }} | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 | ||
| with: | ||
| go-version: ${{ env.GO_VERSION }} | ||
| cache-dependency-path: go.sum | ||
|
|
||
| - name: Set up Hugo | ||
| uses: peaceiris/actions-hugo@2752ce1d29631191ea3f27c23495fa06139a5b78 # v3 | ||
| with: | ||
| hugo-version: ${{ env.HUGO_VERSION }} | ||
| extended: true | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
|
|
||
| - name: Synchronize Hugo module revisions | ||
| run: python3 tools/sync_hugo_modules.py | ||
|
|
||
| - name: Verify updated modules | ||
| run: hugo mod verify | ||
|
|
||
| - name: Commit and push update | ||
| run: | | ||
| if git diff --quiet -- go.mod go.sum; then | ||
| echo "Hugo modules are already up to date." | ||
| exit 0 | ||
| fi | ||
|
|
||
| git config --local user.name "precice-bot" | ||
| git config --local user.email "info@precice.org" | ||
| git commit -m "Update submodules" -a | ||
| - name: Push commit | ||
| uses: ad-m/github-push-action@master | ||
| with: | ||
| github_token: ${{ steps.app-token.outputs.token }} | ||
| branch: ${{ github.ref }} | ||
| git add go.mod go.sum | ||
| git commit --message "Update Hugo modules" | ||
| git push origin "HEAD:${GITHUB_REF_NAME}" |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.