Skip to content

Update backup.yml

Update backup.yml #20

Workflow file for this run

name: Backup Main Branch
on:
push:
branches:
- main
jobs:
backup:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v2
with:
ref: main
- name: Archive main branch as tar.gz
run: |
tar -czf main_backup_$(date +"%Y%m%d").tar.gz *
working-directory: ${{ github.workspace }}
- name: Set up Git
run: |
git config --global user.email "miaogongzi0227@gmail.com"
git config --global user.name "mgz0227"
- name: Create and push backup branch
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: backup
directory: ./
force: true