Backup org #1
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: Backup org | |
| on: | |
| workflow_dispatch: | |
| # schedule: | |
| # At 04:05 everyday | |
| # - cron: '45 4 * * *' | |
| jobs: | |
| org-migration-backupto-s3: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get GitHub User Data | |
| uses: docker://ghcr.io/amitsaha/gitbackup:latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITBACKUP_TOKEN}} | |
| with: | |
| args: -service github -github.createUserMigration -ignore-fork -github.repoType owner -dir . | |
| - name: Push to S3 | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY}} | |
| AWS_DEFAULT_REGION: 'ap-southeast-2' | |
| run: | | |
| aws s3 cp github.com/. s3://gitbackup-echorand/ --recursive --include "*.tar.gz" |