-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1091 from RasaHQ/sec-217
Add backup to s3
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Backup Rasa SDK repo to S3 | ||
on: | ||
schedule: | ||
# Run cron job at 7AM Monday to Sunday. | ||
- cron: "0 7 * * *" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
backup: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@8c3f20df09ac63af7b3ae3d7c91f105f857d8497 #v3.0.1 | ||
with: | ||
role-to-assume: ${{ secrets.GIT_BACKUP_ROLE_ARN }} | ||
aws-region: eu-central-1 | ||
|
||
# Determine the date in the right format for us to tag the image. | ||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | ||
|
||
- name: Create Git bundle | ||
run: git bundle create --progress rasa-sdk-${{ steps.date.outputs.date }}.bundle --all | ||
|
||
- name: Verify Git bundle | ||
run: git bundle verify rasa-sdk-${{ steps.date.outputs.date }}.bundle | ||
|
||
- name: Upload bundle to S3 | ||
run: aws s3 cp rasa-sdk-${{ steps.date.outputs.date }}.bundle s3://${{ secrets.GIT_BACKUP_BUCKET }}/rasa-sdk/ |