Skip to content

Deploy to Staging

Deploy to Staging #73

name: Deploy to Staging
concurrency:
group: staging
cancel-in-progress: true
on:
workflow_run:
workflows: ["CI"]
types:
- completed
branches:
- main
jobs:
deploy:
environment:
name: staging
url: https://staging.benefactorum.org
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Ruby
uses: ruby/[email protected]
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Configure SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Expose GitHub Runtime for cache
uses: crazy-max/[email protected]
- name: Release Kamal lock
run: bundle exec kamal lock release
- name: Deploy with Kamal
env:
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
KAMAL_REGISTRY_PASSWORD: ${{ secrets.KAMAL_REGISTRY_PASSWORD }}
VERSION: ${{ github.sha }}
run: bundle exec kamal deploy -d staging --version=$VERSION