From 63f99f17179d331bf3e0f2a45483c51d60e306dd Mon Sep 17 00:00:00 2001 From: David Pomerenke <46022183+davidpomerenke@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:45:47 +0000 Subject: [PATCH 1/3] ci(deploy.yml): only trigger build-and-push and deploy on push --- .github/workflows/deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6a1743aa..b61a5a92 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -61,6 +61,7 @@ jobs: ZENROWS_API_KEY: ${{ secrets.ZENROWS_API_KEY }} build-and-push: + if: ${{ github.event_name == 'push' }} needs: test runs-on: ubuntu-22.04 outputs: @@ -99,6 +100,7 @@ jobs: run: docker push --all-tags socialchangelab/media-impact-monitor deploy: + if: ${{ github.event_name == 'push' }} needs: build-and-push runs-on: ubuntu-22.04 steps: From aa633ca0e481c57d6ccea93f968abcaf4b005cae Mon Sep 17 00:00:00 2001 From: David Pomerenke <46022183+davidpomerenke@users.noreply.github.com> Date: Fri, 26 Apr 2024 22:20:31 +0000 Subject: [PATCH 2/3] ci(poetry): load poetry env automatically --- .devcontainer/postCreateCommand.sh | 2 +- .devcontainer/postStartCommand.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index c9e23eb1..3cdaf3b6 100644 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -48,4 +48,4 @@ Rscript -e 'renv::restore(project = "/workspaces/media-impact-monitor/backend-R" #### echo 'eval "$(starship init bash)"' >> ~/.bashrc -cd backend-python && poetry install # install everything once at setup \ No newline at end of file +cd backend-python && poetry config virtualenvs.in-project true && poetry install # install everything once at setup diff --git a/.devcontainer/postStartCommand.sh b/.devcontainer/postStartCommand.sh index b3021c39..60bf6fde 100644 --- a/.devcontainer/postStartCommand.sh +++ b/.devcontainer/postStartCommand.sh @@ -1,5 +1,5 @@ #!/usr/bin/bash ## postStartCommand.sh -cd backend-python && poetry install # install changed packages +cd backend-python && source .venv/bin/activate && poetry install # install changed packages # bash From 1e4b646c25aeca855b09ab7f76fabcdbcb2d2087 Mon Sep 17 00:00:00 2001 From: Lennart Klein <31488915+kleinlennart@users.noreply.github.com> Date: Wed, 8 May 2024 19:07:29 +0000 Subject: [PATCH 3/3] build(devcontainer): update python.defaultInterpreterPath to .venv Closes #42 --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 104697ca..3db208cd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -135,7 +135,7 @@ ], "files.autoSave": "onFocusChange", "mypy-type-checker.importStrategy": "fromEnvironment", - "python.defaultInterpreterPath": "/opt/greenwashing-env/bin/python", + "python.defaultInterpreterPath": "${workspaceFolder}/backend-python/.venv", "python.terminal.activateEnvironment": false, "python.testing.pytestEnabled": true, "ruff.importStrategy": "fromEnvironment"