Skip to content

Restore from S3 Backup #34

Restore from S3 Backup

Restore from S3 Backup #34

Workflow file for this run

name: Restore from S3 Backup
on:
workflow_run:
workflows: ["Deploy Feldera Pipeline"]
types:
- completed
workflow_dispatch:
jobs:
restore:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v4 # repo checkout
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Rust Cache # cache the rust build artefacts
uses: Swatinem/rust-cache@v2
- name: Download and install fda binary
run: cargo install fda
# Set up AWS CLI
- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
# Ensure the restore script is executable
- name: Make backup script executable
run: chmod +x ./backup/restore.sh
# Run the restore script
- name: Run restore script
env:
FELDERA_HOST: ${{ secrets.FELDERA_HOST }}
FELDERA_API_KEY: ${{ secrets.FELDERA_API_KEY }}
run: ./backup/restore.sh
# Restart the backend *this invalidates the cell cache just in case*
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: cd server && flyctl apps restart
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}