From e9722fb68c229c5e2c4bce38f1cd12d1edce8824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=BChler=20Ma=C3=ABlys?= Date: Sat, 30 Mar 2024 15:00:55 +0100 Subject: [PATCH] try to change syntax --- .github/workflows/deploy.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e69de29..580f328 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +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 \ No newline at end of file