Deploy to Staging #73
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: 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 |