Skip to content

Commit

Permalink
CD(scaleway): docker image set PROJECT_VERSION instead of always late…
Browse files Browse the repository at this point in the history
…st (#102)

* wip: get PROJECT_VERSION for docker image

* wip ci

* wip: without git push

* tag with latest

* wip

* docker push all tags

* fix
  • Loading branch information
polomarcus authored Feb 11, 2024
1 parent 819518f commit 345d72d
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,44 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Poetry install & bump version
run: |
poetry install --only dev
poetry version patch
PROJECT_VERSION=$(poetry version --short)
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
git config user.name barometre-github-actions
git config user.email [email protected]
git add pyproject.toml
git commit -m "[no ci]: ${{ env.PROJECT_VERSION }} bumping version"
git push origin main
- name: Login to Scaleway Container Registry
uses: docker/login-action@v3
with:
username: nologin
password: ${{ secrets.SCALEWAY_API_KEY }}
registry: ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}

- name: Build mediatree_import image
run: docker build -f Dockerfile_api_import . -t ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/mediatree_import:${{ env.PROJECT_VERSION }}
- name: Tag mediatree_import latest image
run: docker tag ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/mediatree_import:${{ env.PROJECT_VERSION }} ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/mediatree_import:latest
- name: Push mediatree_import Image
run: docker push --all-tags ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/mediatree_import

- name: Build ingest_to_db image
run: docker build -f Dockerfile_ingest . -t ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/ingest_to_db
- name: Push ingest_to_db Image
run: docker push ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/ingest_to_db

- name: Build mediatree_import image
run: docker build -f Dockerfile_api_import . -t ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/mediatree_import:test-pagination
- name: Push mediatree_import Image
run: docker push ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/mediatree_import:test-pagination

- name: Build streamlit image
run: docker build -f Dockerfile_streamlit . -t ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/streamlit
- name: Push streamlit Image
run: docker push ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/streamlit
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Poetry install & bump version
run: |
poetry install --only dev
poetry version patch
git config user.name barometre-github-actions
git config user.email [email protected]
git add pyproject.toml
git commit -m "[no ci]: bumping version"
git push origin main

1 comment on commit 345d72d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
postgres
   insert_data.py46785%38–40, 59–61, 66
   insert_existing_data_example.py20385%25–27
postgres/schemas
   models.py711579%74–81, 91–92, 101–111
quotaclimat/data_analytics
   analytics_signataire_charte.py29290%1–67
   bilan.py1081080%2–372
   data_coverage.py34340%1–94
   exploration.py1251250%1–440
   sitemap_analytics.py1181180%1–343
quotaclimat/data_ingestion
   categorization_program_type.py110%1
   config_youtube.py110%1
   scaleway_db_backups.py34340%1–74
   scrap_chartejournalismeecologie_signataires.py50500%1–169
   scrap_sitemap.py1341787%27–28, 33–34, 66–71, 95–97, 138–140, 202, 223–228
   scrap_tv_program.py62620%1–149
   scrap_youtube.py1141140%1–238
quotaclimat/data_ingestion/ingest_db
   ingest_sitemap_in_db.py544026%18–39, 42–61, 65–76
quotaclimat/data_ingestion/scrap_html
   scrap_description_article.py36392%19–20, 32
quotaclimat/data_processing/mediatree
   api_import.py2249856%29, 33, 37–66, 72–87, 92–94, 202–209, 215–222, 226–229, 233–235, 247–258, 261–265, 271, 296–297, 303, 305, 308–330, 334–345
   utils.py562162%20–44, 47, 66–67
quotaclimat/data_processing/sitemap
   sitemap_processing.py412734%15–19, 23–25, 29–47, 51–58, 66–96, 101–103
quotaclimat/utils
   channels.py660%1–95
   climate_keywords.py220%3–35
   healthcheck_config.py291452%22–24, 27–38
   logger.py14379%22–24
   plotly_theme.py17170%1–56
TOTAL145094935% 

Tests Skipped Failures Errors Time
32 0 💤 0 ❌ 0 🔥 10.144s ⏱️

Please sign in to comment.