Deploy #14
This file contains hidden or 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 | |
| on: | |
| workflow_run: | |
| workflows: ["CI"] | |
| branches: [main] | |
| types: | |
| - completed | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: false # deploy is disabled by default | |
| # uncomment to enable: | |
| # if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| timeout-minutes: 20 | |
| env: | |
| DOCKER_BUILDKIT: 1 | |
| BUNDLE_ONLY: deploy | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Setup SSH | |
| uses: webfactory/[email protected] | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: Deploy | |
| env: | |
| VERSION: ${{ github.sha }} | |
| KAMAL_REGISTRY_PASSWORD: ${{ secrets.KAMAL_REGISTRY_PASSWORD }} | |
| RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
| run: bundle exec kamal deploy --version=$VERSION |