Bump django from 6.0.2 to 6.0.3 #397
Workflow file for this run
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: Pipeline RC | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - develop | |
| jobs: | |
| # Job 1: Run Tests | |
| run-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| # Install a specific version of uv. | |
| version: "0.6.13" | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Run tests with coverage | |
| run: | | |
| export UV_PROJECT_ENVIRONMENT="${pythonLocation}" | |
| uv sync --only-dev | |
| export ROOT_DIR=${GITHUB_WORKSPACE}/ | |
| export DJANGO_SECRET_KEY="test_key" | |
| export DEBUG_TOOLBAR="True" | |
| uv run pytest src/core src/users/ src/blog --cov=src --cov-report=xml | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage.xml | |
| # Job 2: SonarQube Analysis | |
| sonar-analysis: | |
| runs-on: ubuntu-latest | |
| needs: run-tests | |
| if: github.event_name == 'push' # Only run on pushes | |
| environment: develop | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Download coverage report | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage-report | |
| - name: Run SonarQube Scanner | |
| uses: sonarsource/sonarqube-scan-action@v6 | |
| with: | |
| projectBaseDir: . | |
| args: > | |
| -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }} | |
| -Dsonar.sources=src/ | |
| -Dsonar.exclusions=**/migrations/** | |
| -Dsonar.organization=${{ vars.SONAR_ORGANIZATION }} | |
| -Dsonar.host.url=${{ vars.SONAR_HOST_URL }} | |
| -Dsonar.token=${{ secrets.SONAR_TOKEN }} | |
| -Dsonar.python.coverage.reportPaths=coverage.xml | |
| -Dsonar.coverage.exclusions=**/migrations/**,**/tests/**,**/wsgi.py,**/admin.py,**/asgi.py,**/manage.py,**/ui_tests/**,**/*.css,**/*.js,**/*.jinja2 | |
| -Dsonar.cpd.exclusions=**/migrations/** | |
| -Dsonar.python.version=3.13 | |
| # Job 3: Build and Deploy | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| needs: [run-tests, sonar-analysis] | |
| if: github.event_name == 'push' # Only run on pushes | |
| environment: develop | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USER }} | |
| password: ${{ secrets.DOCKER_HUB_PASS }} | |
| - name: Build and push for develop branch | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| push: true | |
| tags: jandigarte/django:dev | |
| target: base | |
| cache-from: type=registry,ref=jandigarte/django:dev | |
| - name: Build and push for tags | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| push: true | |
| tags: jandigarte/django:${{ github.ref_name }} | |
| target: base | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ vars.AWS_REGION }} | |
| - name: Update ECS service | |
| run: | | |
| echo "Deploying to Development environment" | |
| echo "ECS Cluster: ${{ env.ECS_CLUSTER }}" | |
| echo "ECS Service: ${{ env.ECS_SERVICE }}" | |
| aws ecs update-service --cluster ${{ vars.ECS_CLUSTER }} --service ${{ vars.ECS_SERVICE }} --force-new-deployment |