Reset Staging DB #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]" |