Skip to content

Commit

Permalink
Merge branch 'main' into mnyamunda/toggle-button-update
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsteinig authored Oct 18, 2024
2 parents d97c52b + eda333b commit eac6ade
Show file tree
Hide file tree
Showing 17 changed files with 892 additions and 59 deletions.
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Use LF for all text files
* text eol=lf

# Image files are auto detected
*.gif -text
*.jpg -text
*.jpeg -text
*.pdf -text
*.png -text
*.webp -text

# Binary data files
*.db binary
*.grib binary
*.idx binary
5 changes: 2 additions & 3 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: pr-build

on:
pull_request:
types: ['opened', 'reopened', 'synchronize']
pull_request_target:
branches:
- 'main'

Expand Down Expand Up @@ -192,7 +191,7 @@ jobs:
working-directory: 'air-quality-ui'

- name: Run tests with coverage
uses: ArtiomTr/jest-coverage-report-action@v2.0-rc.6
uses: ArtiomTr/jest-coverage-report-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: 'air-quality-ui'
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/reusable-docker-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Reusable deploy

on:
workflow_dispatch:
inputs:
environment:
required: true
type: string
jobs:
deploy:
name: deploy image
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}

steps:
- name: checkout
uses: actions/checkout@v4
- name: install ssh keys
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ vars.SSH_HOST }} > ~/.ssh/known_hosts
- name: create .env
run: |
ssh ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }} "cd /usr/config && \\
echo MONGO_DB_URI=${{ secrets.MONGO_URI }} | sudo tee .env && \\
echo MONGO_DB_NAME=${{ secrets.MONGO_DB_NAME }} | sudo tee -a .env && \\
echo OPEN_AQ_API_URL=${{ secrets.OPEN_AQ_API_URL }} | sudo tee -a .env && \\
echo OPEN_AQ_API_KEY=${{ secrets.OPEN_AQ_API_KEY }} | sudo tee -a .env && \\
echo CDSAPI_URL=${{ secrets.CDSAPI_URL }} | sudo tee -a .env && \\
echo CDSAPI_KEY=${{ secrets.CDSAPI_KEY }} | sudo tee -a .env && \\
exit"
- name: copy compose
run: |
scp deployment/compose-${{ inputs.environment }}.yaml ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }}:/usr/config/compose.yaml
- name: activate docker
run: |
ssh ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }} "cd /usr/config && \\
echo ${{ secrets.GITHUB_TOKEN}} | sudo docker login --username ${{ github.actor }} --password-stdin ghcr.io
sudo docker compose pull
sudo docker compose up --force-recreate --build -d
sudo docker image prune -f
exit"
- name: clean up
run: |
rm -rf ~/.ssh
36 changes: 36 additions & 0 deletions .github/workflows/reusable-frontend-ui-docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and publish UI docker image
on:
workflow_dispatch:
inputs:
environment:
required: true
type: string
jobs:
publish_image:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
permissions:
contents: read
packages: write
steps:
- name: checkout
uses: actions/checkout@v4

- name: lowercase the repository name
run: |
echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}"
- name: login
run: |
echo ${{ secrets.GITHUB_TOKEN}} | docker login --username ${{ github.actor }} --password-stdin ghcr.io
- name: build
run: |
cd air-quality-ui
docker build . -t ghcr.io/${REPO}/vairify-frontend-${{ inputs.environment }}:latest \
--build-arg VITE_AIR_QUALITY_API_URL=${{ vars.VAIRIFY_API_URL }} \
--build-arg VITE_AIR_QUALITY_UI_URL=${{ vars.VAIRIFY_UI_URL }}
- name: publish
run: |
docker push ghcr.io/${REPO}/vairify-frontend-${{ inputs.environment }}:latest
106 changes: 57 additions & 49 deletions air-quality-backend/etl/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions air-quality-backend/etl/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ authors = ["weather-machinists"]
package-mode = false

[tool.poetry.dependencies]
cads-api-client = "1.0.3"
cdsapi = "0.7.0"
cads-api-client = "1.3.2"
cdsapi = "0.7.3"
flake8 = "7.0.0"
python = "3.11.9"
pymongo = "4.6.3"
Expand All @@ -17,6 +17,7 @@ scipy = "1.13.0"
tqdm = "4.66.4"
typing-extensions = "4.11.0"
multiurl = "0.3.1"
numpy = "1.26.4"
six = "1.16.0"
setuptools = "70.0.0"

Expand Down
Loading

0 comments on commit eac6ade

Please sign in to comment.