Sync to microsite #2
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: Sync to microsite | |
| # Fires on every push to canonical master. | |
| # Pulls the microsite repo via SSH deploy key, bumps the content-src | |
| # submodule pointer to this commit, pushes back. The microsite repo's | |
| # own deploy.yml workflow then handles build + Cloudflare Pages deploy. | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| concurrency: | |
| group: sync-microsite | |
| cancel-in-progress: false | |
| jobs: | |
| bump-submodule: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout microsite via SSH deploy key | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: memdigital/thou-art-that-microsite | |
| ssh-key: ${{ secrets.MICROSITE_DEPLOY_KEY }} | |
| submodules: recursive | |
| path: microsite | |
| fetch-depth: 1 | |
| - name: Bump content-src submodule to canonical HEAD | |
| env: | |
| CANONICAL_SHA: ${{ github.sha }} | |
| run: | | |
| cd microsite | |
| git submodule update --remote content-src | |
| if [ -z "$(git status --porcelain content-src)" ]; then | |
| echo "Submodule already at canonical HEAD; nothing to push." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add content-src | |
| short_sha=$(echo "$CANONICAL_SHA" | cut -c1-7) | |
| git commit -m "chore(content-src): auto-bump to canonical $short_sha" | |
| git push |