commit 667c9a3a1bb82b1aaa017c5665db0996cee8bda0 parent 1171296e52312d94feb685cc84240a95cf78f971 Author: Amit Dutta <mail@amit.is-a.dev> Date: Tue, 18 Aug 2026 19:11:35 +0530 Add backup job to GitHub Actions workflow This workflow adds a backup job that generates a ZIP backup of the repository, creates a GitHub release for the backup, and includes timestamps in IST format. Diffstat:
| M | .github/workflows/main.yml | | | 38 | ++++++++++++++++++++++++++++++++++++++ |
1 file changed, 38 insertions(+), 0 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml @@ -127,6 +127,44 @@ jobs: with: path: docs/.vitepress/dist + backup: + runs-on: ubuntu-latest + needs: build + if: github.actor != 'bot-for-notamitgamer[bot]' + steps: + - name: Generate GitHub App Token + id: app-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + + - name: Checkout Latest Code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + token: ${{ steps.app-token.outputs.token }} + ref: main + + - name: Get IST Date and Time + id: datetime + run: | + echo "TIMESTAMP=$(TZ='Asia/Kolkata' date +'%Y-%m-%d_%H-%M-%S')" >> $GITHUB_ENV + echo "PRETTY_DATE=$(TZ='Asia/Kolkata' date +'%d %B %Y, %I:%M %p IST')" >> $GITHUB_ENV + + - name: Create ZIP Backup + run: zip -r "full-repo-backup-${{ env.TIMESTAMP }}.zip" . -x "*.git*" + + - name: Update Rolling Release + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + run: | + gh release delete latest-backup -y --cleanup-tag || true + + gh release create "latest-backup" "full-repo-backup-${{ env.TIMESTAMP }}.zip" \ + --title "Latest Backup - ${{ env.PRETTY_DATE }}" \ + --notes "Automated repository backup generated on ${{ env.PRETTY_DATE }}." + deploy: environment: name: github-pages