Merge pull request #179 from HE-Arc/add-gunicorn-script #62
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 production | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout repository" | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1.172.0 | |
with: | |
bundler-cache: true | |
- name: Install SSH key | |
uses: webfactory/ssh-agent@v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Add known host | |
run: | | |
ssh-keyscan -p ${{ secrets.DEPLOY_HOST_SSH_PORT }} ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts | |
- name: Test SSH connection | |
run: | | |
ssh -vvv ${{ secrets.DEPLOY_USERNAME }}@${{ secrets.DEPLOY_HOST }} -p${{ secrets.DEPLOY_HOST_SSH_PORT }} | |
- name: Deploy | |
env: | |
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} | |
DEPLOY_USERNAME: ${{ secrets.DEPLOY_USERNAME }} | |
DEPLOY_HOST_SSH_PORT: ${{ secrets.DEPLOY_HOST_SSH_PORT }} | |
run: | | |
bundle exec cap production deploy |