Skip to content

Reset Staging DB

Reset Staging DB #12

name: Reset Staging DB
on:
workflow_dispatch:
jobs:
reset:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.CI_CD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CI_CD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Trigger reload command
run: |
task_arn="$(
aws ecs list-tasks \
--region us-west-2 \
--cluster wca-on-rails \
--service-name wca-on-rails-staging \
--query "taskArns[0]" \
--output text
)"
aws ecs execute-command \
--region us-west-2 \
--cluster wca-on-rails \
--task $task_arn \
--container rails-staging \
--command "/rails/bin/rake db:load:development[reload]"