├── .gitignore ├── README.md └── github-actions-capistrano.yml /.gitignore: -------------------------------------------------------------------------------- 1 | .idea -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Various CI/CD for Rails Apps 2 | 3 | Check out the wiki documentation for more details. -------------------------------------------------------------------------------- /github-actions-capistrano.yml: -------------------------------------------------------------------------------- 1 | name: Deploy To Server 2 | 3 | on: 4 | # Deploy on merge to main 5 | push: 6 | branches: [ main ] 7 | # # Manually deploy branch 8 | # workflow_dispatch: 9 | # branches: [ main ] 10 | 11 | jobs: 12 | deploy: 13 | name: Capistrano Deploy to Server 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - name: Install SSH key to Server 18 | uses: shimataro/ssh-key-action@v2 19 | with: 20 | key: ${{ secrets.SSH_KEY }} 21 | name: github-actions 22 | known_hosts: 'random-placeholder-value-replaced-by-keyscan-below' 23 | config: | 24 | host *example.com 25 | IdentityFile ~/.ssh/github-actions 26 | IdentitiesOnly yes 27 | ForwardAgent yes 28 | 29 | - name: Adding Known Hosts 30 | run: ssh-keyscan -H ${{ secrets.SSH_HOST }} 31 | 32 | - uses: actions/checkout@v2 33 | - name: Set up Ruby 34 | uses: ruby/setup-ruby@v1 35 | with: 36 | ruby-version: 2.4.1 37 | bundler-cache: true # runs 'bundle install' and caches installed gems automatically 38 | 39 | - name: Deploy to production 40 | run: | 41 | eval "$(ssh-agent -s)" 42 | ssh-add ~/.ssh/github-actions 43 | bundle exec cap production deploy --------------------------------------------------------------------------------