add a column to to identify media that have print and media versions #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Deploy Print media image to Scaleway | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev/print_media | |
| workflow_dispatch: | |
| env: | |
| PYTHON_VERSION: '3.12' | |
| POETRY_VERSION: '2.1.3' | |
| jobs: | |
| build-factiva: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - 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] | |
| CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
| echo "Current branch: $CURRENT_BRANCH" | |
| git add pyproject.toml | |
| git commit -m "[no ci]: $PROJECT_VERSION bumping version" | |
| git push origin "$CURRENT_BRANCH" | |
| - 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 factiva_stats_to_s3 image | |
| run: docker build --no-cache -f Dockerfile_factiva_stats_to_s3 . -t ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/factiva_stats_to_s3:${{ env.PROJECT_VERSION }} | |
| - name: Tag factiva_stats_to_s3 latest image | |
| run: docker tag ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/factiva_stats_to_s3:${{ env.PROJECT_VERSION }} ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/factiva_stats_to_s3:latest | |
| - name: Push factiva_stats_to_s3 Image | |
| run: docker push --all-tags ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/factiva_stats_to_s3 | |
| - name: Build factiva_to_s3 image | |
| run: docker build --no-cache -f Dockerfile_factiva_to_s3 . -t ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/factiva_to_s3:${{ env.PROJECT_VERSION }} | |
| - name: Tag factiva_to_s3 latest image | |
| run: docker tag ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/factiva_to_s3:${{ env.PROJECT_VERSION }} ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/factiva_to_s3:latest | |
| - name: Push factiva_to_s3 Image | |
| run: docker push --all-tags ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/factiva_to_s3 | |
| - name: Build s3_factiva_to_postgre image | |
| run: docker build --no-cache -f Dockerfile_s3_factiva_to_postgre . -t ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/s3_factiva_to_postgre:${{ env.PROJECT_VERSION }} | |
| - name: Tag s3_factiva_to_postgre latest image | |
| run: docker tag ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/s3_factiva_to_postgre:${{ env.PROJECT_VERSION }} ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/s3_factiva_to_postgre:latest | |
| - name: Push s3_factiva_to_postgre Image | |
| run: docker push --all-tags ${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/s3_factiva_to_postgre | |
| - name: Update Scaleway job definition with Factiva Stats image | |
| uses: jawher/[email protected] | |
| env: | |
| SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} | |
| SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
| SCW_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID }} | |
| SCW_ZONE: ${{ secrets.SCW_ZONE }} | |
| with: | |
| args: jobs definition update ${{ secrets.SCALEWAY_JOB_FACTIVA_STATS_ID }} image-uri=${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/factiva_stats_to_s3:${{ env.PROJECT_VERSION }} | |
| - name: Update Scaleway job definition with Factiva to S3 image | |
| uses: jawher/[email protected] | |
| env: | |
| SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} | |
| SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
| SCW_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID }} | |
| SCW_ZONE: ${{ secrets.SCW_ZONE }} | |
| with: | |
| args: jobs definition update ${{ secrets.SCALEWAY_JOB_FACTIVA_TO_S3_ID }} image-uri=${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/factiva_to_s3:${{ env.PROJECT_VERSION }} | |
| - name: Update Scaleway job definition with S3 Factiva to Postgre image | |
| uses: jawher/[email protected] | |
| env: | |
| SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} | |
| SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
| SCW_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID }} | |
| SCW_ZONE: ${{ secrets.SCW_ZONE }} | |
| with: | |
| args: jobs definition update ${{ secrets.SCALEWAY_JOB_S3_FACTIVA_TO_POSTGRE_ID }} image-uri=${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/s3_factiva_to_postgre:${{ env.PROJECT_VERSION }} |