Skip to content

Commit

Permalink
Add GitHub Actions to seed data
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoroth committed Nov 10, 2024
1 parent 1533126 commit 20188bf
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release-lock-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
with:
bundler: default
bundler-cache: true
- name: Deploy to Staging
- name: Deploy to Production
run: bundle exec kamal lock release
26 changes: 26 additions & 0 deletions .github/workflows/seed-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Seed Production

on: workflow_dispatch

jobs:
seed-production:
name: Seed Production
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler: default
bundler-cache: true

- name: Run db:seed on Production
run: bundle exec kamal app exec --reuse "bin/rails db:seed"
26 changes: 26 additions & 0 deletions .github/workflows/seed-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Seed Staging

on: workflow_dispatch

jobs:
seed-staging:
name: Seed Staging
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler: default
bundler-cache: true

- name: Run db:seed on Staging
run: bundle exec kamal app exec --reuse "bin/rails db:seed" -d staging

0 comments on commit 20188bf

Please sign in to comment.