Skip to content

Commit 2ef8932

Browse files
WIP: Gitbackup
1 parent 598153d commit 2ef8932

1 file changed

Lines changed: 30 additions & 15 deletions

File tree

.github/workflows/backup-org.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
11
name: Backup org
22

33
on:
4-
workflow_dispatch:
5-
# schedule:
6-
# At 04:05 everyday
4+
workflow_dispatch:
5+
# schedule:
6+
# At 04:05 everyday
77
# - cron: '45 4 * * *'
88

99
jobs:
1010
org-migration-backupto-s3:
1111
runs-on: ubuntu-latest
12+
13+
container:
14+
image: ghcr.io/amitsaha/gitbackup:1.1
15+
credentials:
16+
username: ${{ github.actor }}
17+
password: ${{ secrets.GITHUB_TOKEN }}
18+
19+
1220
steps:
1321
- name: Get GitHub User Data
14-
uses: docker://ghcr.io/amitsaha/gitbackup:latest
1522
env:
16-
GITHUB_TOKEN: ${{ secrets.GITBACKUP_TOKEN}}
17-
with:
18-
args: -service github -github.createUserMigration -ignore-fork -github.repoType owner -dir .
19-
20-
21-
- name: Push to S3
22-
env:
23-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}}
24-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY}}
25-
AWS_DEFAULT_REGION: 'ap-southeast-2'
23+
GITHUB_TOKEN: ${{ secrets.GITBACKUP_TOKEN }}
2624
run: |
27-
aws s3 cp github.com/. s3://gitbackup-echorand/ --recursive --include "*.tar.gz"
25+
gitbackup \
26+
-service github \
27+
-github.createUserMigration \
28+
-ignore-fork \
29+
-github.repoType owner \
30+
-dir /backup
31+
32+
# - name: Install AWS CLI
33+
# run: |
34+
# apt-get update && apt-get install -y awscli
35+
#
36+
# - name: Upload to S3
37+
# env:
38+
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
39+
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
40+
# AWS_DEFAULT_REGION: ap-southeast-2
41+
# run: |
42+
# aws s3 cp /backup s3://gitbackup-echorand/ --recursive

0 commit comments

Comments
 (0)