Update Lunar Content #13
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 Lunar Content | |
| on: | |
| schedule: | |
| # Run nightly at 2:00 AM UTC | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Earthly | |
| uses: earthly/actions-setup@v1 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Configure Earthly git credentials for private lunar repo | |
| run: | | |
| mkdir -p ~/.earthly | |
| cat > ~/.earthly/config.yml << EOF | |
| git: | |
| github.com: | |
| auth: https | |
| user: x-access-token | |
| password: ${LUNAR_REPO_PAT} | |
| EOF | |
| env: | |
| LUNAR_REPO_PAT: ${{ secrets.LUNAR_REPO_PAT }} | |
| - name: Run update-all | |
| run: earthly +update-all | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| if git diff --quiet && git diff --cached --quiet; then | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push changes | |
| if: steps.changes.outputs.has_changes == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| git commit -m "chore: auto-update update Lunar docs and/or references" | |
| git push |