File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ name : S3 backup
2+ on :
3+ workflow_dispatch :
4+ schedule :
5+ - cron : " 0 6 * * *"
6+
7+ jobs :
8+ s3-backup :
9+ runs-on : ubuntu-latest
10+ steps :
11+
12+ - name : Checkout
13+ uses : actions/checkout@v2
14+ with :
15+ fetch-depth : 0 # retrieve all history
16+
17+ - name : Configure AWS credentials
18+ uses : aws-actions/configure-aws-credentials@v1
19+ with :
20+ aws-access-key-id : ${{ secrets.AWS_S3_BACKUP_ACCESS_KEY_ID }}
21+ aws-secret-access-key : ${{ secrets.AWS_S3_BACKUP_SECRET_ACCESS_KEY }}
22+ aws-region : ca-central-1
23+
24+ - name : Create ZIP bundle
25+ run : |
26+ ZIP_FILE=`basename ${{ github.repository }}`-`date '+%Y-%m-%d'`.zip
27+ zip -rq "${ZIP_FILE}" .
28+ mkdir -p ${{ github.repository }}
29+ mv "${ZIP_FILE}" ${{ github.repository }}
30+
31+ - name : Upload to S3 bucket
32+ run : |
33+ aws s3 sync . s3://${{ secrets.AWS_S3_BACKUP_BUCKET }} --exclude='*' --include='${{ github.repository }}/*'
You can’t perform that action at this time.
0 commit comments