Skip to content

Update backup.yml

Update backup.yml #25

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: Create backup directory
run: mkdir -p backup
- name: Archive main branch as tar.gz
run: |
tar -czf backup/main_backup_$(date +"%Y%m%d").tar.gz *
working-directory: ${{ github.workspace }}
- name: Upload backup to Artifact
uses: actions/upload-artifact@v2
with:
name: backup
path: backup/main_backup_$(bash -c 'echo $(date +"%Y%m%d").tar.gz')
- name: Set up Git
run: |
git config --local user.email "[email protected]"
git config --local user.name "mgz0227"