Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Repo backups workflow #38

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/backups.yml
Original file line number Diff line number Diff line change
@@ -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
ewels marked this conversation as resolved.
Show resolved Hide resolved

- name: Zip dev branch
run: zip -r dev.zip .
ewels marked this conversation as resolved.
Show resolved Hide resolved

- 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: './'