From d09f72f29a0e35d10e109d89ac8bf0afc02f1267 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Fri, 15 Mar 2024 11:52:20 -0500 Subject: [PATCH] ci(backups): Add generated workflow --- .github/workflows/backups.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/backups.yml diff --git a/.github/workflows/backups.yml b/.github/workflows/backups.yml new file mode 100644 index 0000000..7ed2ffd --- /dev/null +++ b/.github/workflows/backups.yml @@ -0,0 +1,49 @@ +name: Clone and Upload to S3 + +on: + schedule: + # Runs at 00:00 UTC every Sunday + - cron: '0 0 * * 0' + +jobs: + clone-and-upload: + runs-on: ubuntu-latest + + steps: + - name: Checkout dev branch + uses: actions/checkout@v2 + with: + ref: dev + + - name: Zip dev branch + run: zip -r dev.zip . + + - name: Upload dev branch to S3 + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks + env: + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'us-west-1' # Your S3 bucket region + SOURCE_DIR: './' + + - name: Checkout master branch + uses: actions/checkout@v2 + with: + ref: master + + - name: Zip master branch + run: zip -r master.zip . + + - name: Upload master branch to S3 + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks + env: + AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'us-west-1' # Your S3 bucket region + SOURCE_DIR: './'