From f869a1a7dcc720decee1ce5a1ce1828044942d83 Mon Sep 17 00:00:00 2001 From: Daniel <93772671+danielMoreirad@users.noreply.github.com> Date: Thu, 21 Mar 2024 10:44:18 +0100 Subject: [PATCH] Create azure-webapps-python.yml --- .github/workflows/azure-webapps-python.yml | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/azure-webapps-python.yml diff --git a/.github/workflows/azure-webapps-python.yml b/.github/workflows/azure-webapps-python.yml new file mode 100644 index 0000000..71b27ca --- /dev/null +++ b/.github/workflows/azure-webapps-python.yml @@ -0,0 +1,36 @@ +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 + ruby-version: 3.0.3 + - 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