Skip to content

Commit 7807b19

Browse files
authored
Merge pull request #13026 from RasaHQ/sec-217
Add backup to s3
2 parents ef5ed2e + 031e018 commit 7807b19

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/git-backup.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Backup Rasa repo to S3
2+
on:
3+
schedule:
4+
# Run cron job at 7AM Monday to Sunday.
5+
- cron: "0 7 * * *"
6+
workflow_dispatch:
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
12+
jobs:
13+
backup:
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Configure AWS credentials
22+
uses: aws-actions/configure-aws-credentials@8c3f20df09ac63af7b3ae3d7c91f105f857d8497 #v3.0.1
23+
with:
24+
role-to-assume: ${{ secrets.GIT_BACKUP_ROLE_ARN }}
25+
aws-region: ${{ secrets.GIT_BACKUP_REGION }}
26+
27+
# Determine the date in the right format for us to tag the image.
28+
- name: Get current date
29+
id: date
30+
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
31+
32+
- name: Create Git bundle
33+
run: git bundle create --progress rasa-${{ steps.date.outputs.date }}.bundle --all
34+
35+
- name: Verify Git bundle
36+
run: git bundle verify rasa-${{ steps.date.outputs.date }}.bundle
37+
38+
- name: Upload bundle to S3
39+
run: aws s3 cp rasa-${{ steps.date.outputs.date }}.bundle s3://${{ secrets.GIT_BACKUP_BUCKET }}/rasa/

0 commit comments

Comments
 (0)