From efe0bcd761f0df5519942813d8875d6ca2e7f859 Mon Sep 17 00:00:00 2001 From: Artur Czepiel Date: Sun, 19 Jan 2025 18:09:53 +0100 Subject: [PATCH] merge workflows --- ...test_and_lint.yml => build_and_deploy.yml} | 26 +++++++++++++++ .github/workflows/deploy.yml | 32 ------------------- 2 files changed, 26 insertions(+), 32 deletions(-) rename .github/workflows/{build_test_and_lint.yml => build_and_deploy.yml} (67%) delete mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/build_test_and_lint.yml b/.github/workflows/build_and_deploy.yml similarity index 67% rename from .github/workflows/build_test_and_lint.yml rename to .github/workflows/build_and_deploy.yml index 0ebfb69..c5195e9 100644 --- a/.github/workflows/build_test_and_lint.yml +++ b/.github/workflows/build_and_deploy.yml @@ -58,3 +58,29 @@ jobs: --health-timeout=5s --health-retries=5 + deploy: + needs: build-test-and-lint + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Set up SSH key + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }} + + - name: Set up ssh + run: | + mkdir -p ~/.ssh + echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + ssh-keyscan "internal.europython.eu" > ~/.ssh/known_hosts + + - name: Run deployment + run: make deploy/app diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 6d75e82..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Deploy latest version of the app - -on: - push: - branches: - - main - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Set up SSH key - uses: webfactory/ssh-agent@v0.9.0 - with: - ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }} - - - name: Set up ssh - run: | - mkdir -p ~/.ssh - echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519 - chmod 600 ~/.ssh/id_ed25519 - ssh-keyscan "internal.europython.eu" >> ~/.ssh/known_hosts - - - name: Run deployment - run: make deploy/app