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