Borg Backups #1133
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: Generate DNS change plan | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| octodns-sync: | |
| name: Run `octodns-sync` with production.yaml | |
| runs-on: ubuntu-latest | |
| outputs: | |
| plan: ${{ steps.generate-plan.outputs.plan }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| activate-environment: true | |
| - name: Install dependencies | |
| run: uv sync --frozen --only-group dns | |
| - uses: solvaholic/octodns-sync@main | |
| id: generate-plan | |
| with: | |
| config_path: dns/production.yaml | |
| force: "Yes" | |
| env: | |
| CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_RO_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| add-pr-comment: | |
| name: Add `octodns-sync` plan to comment | |
| if: ${{ ! contains(needs.octodns-sync.outputs.plan, 'No changes were planned') }} | |
| needs: [octodns-sync] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Find previous comment, if present | |
| uses: peter-evans/find-comment@v3 | |
| id: fc | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| comment-author: github-actions[bot] | |
| body-includes: "OctoDNS Plan for " | |
| - name: Create or update comment | |
| id: prcomment | |
| uses: peter-evans/create-or-update-comment@v4 | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| comment-id: ${{ steps.fc.outputs.comment-id }} | |
| body: | | |
| # OctoDNS Plan for `${{ github.event.pull_request.head.ref }}` | |
| ${{ needs.octodns-sync.outputs.plan }} | |
| edit-mode: replace |