Change BASE_TAG from 'psl_latest_v2' to 'latest_v2' #747
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: Build and Push Docker Images | |
| on: | |
| push: | |
| branches: [main, dev, demo, hotfix, psl-docker-build-and-push-v2] | |
| paths: | |
| - 'src/ContentProcessor/src/**' | |
| - 'src/**/Dockerfile' | |
| - 'src/**/requirements.txt' | |
| - 'src/**/pyproject.toml' | |
| - 'src/ContentProcessorAPI/app/**' | |
| - 'src/ContentProcessorAPI/helpers/**' | |
| - 'src/ContentProcessorWeb/src/**' | |
| - 'src/ContentProcessorWeb/public/**' | |
| - 'src/ContentProcessorWeb/package.json' | |
| - 'src/ContentProcessorWeb/package-lock.json' | |
| - 'src/ContentProcessorWeb/yarn.lock' | |
| - 'src/ContentProcessorWeb/tsconfig.json' | |
| - 'src/ContentProcessorWeb/config-overrides.js' | |
| - 'src/ContentProcessorWeb/nginx-custom.conf' | |
| - 'src/ContentProcessorWeb/env.sh' | |
| - '.github/workflows/build-docker-image.yml' | |
| pull_request: | |
| branches: [main, dev, demo, hotfix, psl-docker-build-and-push-v2] | |
| types: [opened, ready_for_review, reopened, synchronize] | |
| paths: | |
| - 'src/ContentProcessor/src/**' | |
| - 'src/**/Dockerfile' | |
| - 'src/**/requirements.txt' | |
| - 'src/**/pyproject.toml' | |
| - 'src/ContentProcessorAPI/app/**' | |
| - 'src/ContentProcessorAPI/helpers/**' | |
| - 'src/ContentProcessorWeb/src/**' | |
| - 'src/ContentProcessorWeb/public/**' | |
| - 'src/ContentProcessorWeb/package.json' | |
| - 'src/ContentProcessorWeb/package-lock.json' | |
| - 'src/ContentProcessorWeb/yarn.lock' | |
| - 'src/ContentProcessorWeb/tsconfig.json' | |
| - 'src/ContentProcessorWeb/config-overrides.js' | |
| - 'src/ContentProcessorWeb/nginx-custom.conf' | |
| - 'src/ContentProcessorWeb/env.sh' | |
| - 'infra/**/*.bicep' | |
| - 'infra/**/*.json' | |
| - 'azure.yaml' | |
| - '.github/workflows/build-docker-image.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| actions: read | |
| id-token: write | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| env: | |
| ACR_LOGIN_SERVER: ${{ secrets.ACR_LOGIN_SERVER }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Get current date | |
| id: date | |
| run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
| - name: Login to Azure | |
| if: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' || github.ref_name == 'dependabotchanges' || github.ref_name == 'psl-docker-build-and-push-v2' }} | |
| uses: azure/login@v2 | |
| with: | |
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| - name: Log in to Azure Container Registry | |
| if: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' || github.ref_name == 'dependabotchanges' || github.ref_name == 'psl-docker-build-and-push-v2' }} | |
| run: az acr login --name ${{ env.ACR_LOGIN_SERVER }} | |
| - name: Get registry | |
| id: registry | |
| run: | | |
| echo "ext_registry=${{ env.ACR_LOGIN_SERVER || 'acrlogin.azurecr.io'}}" >> $GITHUB_OUTPUT | |
| - name: Set Docker image tags | |
| id: tag | |
| run: | | |
| BRANCH="${{ github.ref_name }}" | |
| DATE="${{ steps.date.outputs.date }}" | |
| GITHUB_RUN_NUMBER="${{ github.run_number }}" | |
| if [[ "$BRANCH" == "main" ]]; then | |
| BASE_TAG="latest_v2" | |
| elif [[ "$BRANCH" == "dev" ]]; then | |
| BASE_TAG="dev" | |
| elif [[ "$BRANCH" == "demo" ]]; then | |
| BASE_TAG="demo" | |
| elif [[ "$BRANCH" == "hotfix" ]]; then | |
| BASE_TAG="hotfix" | |
| elif [[ "$BRANCH" == "dependabotchanges" ]]; then | |
| BASE_TAG="dependabotchanges" | |
| elif [[ "$BRANCH" == "psl-docker-build-and-push-v2" ]]; then | |
| BASE_TAG="latest_v2" | |
| else | |
| BASE_TAG="pullrequest-ignore" | |
| fi | |
| DATE_TAG="${BASE_TAG}_${DATE}_${GITHUB_RUN_NUMBER}" | |
| echo "BASE_TAG=${BASE_TAG}" >> $GITHUB_ENV | |
| echo "DATE_TAG=${DATE_TAG}" >> $GITHUB_ENV | |
| echo "Base tag: $BASE_TAG, Date tag: $DATE_TAG" | |
| - name: Build and Push ContentProcessor Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./src/ContentProcessor | |
| file: ./src/ContentProcessor/Dockerfile | |
| push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' || github.ref_name == 'dependabotchanges' || github.ref_name == 'psl-docker-build-and-push-v2' }} | |
| tags: | | |
| ${{ steps.registry.outputs.ext_registry }}/contentprocessor:${{ env.BASE_TAG }} | |
| ${{ steps.registry.outputs.ext_registry }}/contentprocessor:${{ env.DATE_TAG }} | |
| - name: Build and Push ContentProcessorAPI Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./src/ContentProcessorAPI | |
| file: ./src/ContentProcessorAPI/Dockerfile | |
| push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' || github.ref_name == 'dependabotchanges' || github.ref_name == 'psl-docker-build-and-push-v2' }} | |
| tags: | | |
| ${{ steps.registry.outputs.ext_registry }}/contentprocessorapi:${{ env.BASE_TAG }} | |
| ${{ steps.registry.outputs.ext_registry }}/contentprocessorapi:${{ env.DATE_TAG }} | |
| - name: Build and Push ContentProcessorWeb Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./src/ContentProcessorWeb | |
| file: ./src/ContentProcessorWeb/Dockerfile | |
| push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' || github.ref_name == 'dependabotchanges' || github.ref_name == 'psl-docker-build-and-push-v2' }} | |
| tags: | | |
| ${{ steps.registry.outputs.ext_registry }}/contentprocessorweb:${{ env.BASE_TAG }} | |
| ${{ steps.registry.outputs.ext_registry }}/contentprocessorweb:${{ env.DATE_TAG }} | |
| - name: Build and Push ContentProcessorWorkflow Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./src/ContentProcessorWorkflow | |
| file: ./src/ContentProcessorWorkflow/Dockerfile | |
| push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' || github.ref_name == 'dependabotchanges' || github.ref_name == 'psl-docker-build-and-push-v2' }} | |
| tags: | | |
| ${{ steps.registry.outputs.ext_registry }}/contentprocessorworkflow:${{ env.BASE_TAG }} | |
| ${{ steps.registry.outputs.ext_registry }}/contentprocessorworkflow:${{ env.DATE_TAG }} |