diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c91fe9e2..4d89e57a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,6 +11,7 @@ on: paths: - 'client/**' - 'api/**' + - 'backoffice/**' - '.github/workflows/*' - 'infrastructure/**' - 'package.json' @@ -28,9 +29,9 @@ jobs: trigger_build: runs-on: ubuntu-latest outputs: - build_client: ${{ steps.changes.outputs.client == 'true' || github.ref_name == 'staging' || github.ref_name == 'main' }} - build_api: ${{ steps.changes.outputs.api == 'true' || github.ref_name == 'staging' || github.ref_name == 'main' }} - build_backoffice: ${{ steps.changes.outputs.backoffice == 'true' || github.ref_name == 'staging' || github.ref_name == 'main' }} + build_client: ${{ github.event_name == 'workflow_dispatch' || steps.changes.outputs.client == 'true' || github.ref_name == 'staging' || github.ref_name == 'main' }} + build_api: ${{ github.event_name == 'workflow_dispatch' || steps.changes.outputs.api == 'true' || github.ref_name == 'staging' || github.ref_name == 'main' }} + build_backoffice: ${{ github.event_name == 'workflow_dispatch' || steps.changes.outputs.backoffice == 'true' || github.ref_name == 'staging' || github.ref_name == 'main' }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -56,7 +57,7 @@ jobs: build_client: needs: [ set_environment_name, trigger_build ] - if: ${{ github.event_name == 'workflow_dispatch' || needs.trigger_build.outputs.build_client == 'true' }} + if: ${{ needs.trigger_build.outputs.build_client == 'true' }} environment: name: ${{ needs.set_environment_name.outputs.env_name }} runs-on: ubuntu-latest @@ -66,7 +67,6 @@ jobs: uses: actions/checkout@v4 - name: Configure AWS credentials - if: ${{ github.event_name == 'workflow_dispatch' || steps.client-changes.outputs.client == 'true' }} uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.PIPELINE_USER_ACCESS_KEY_ID }} @@ -74,18 +74,15 @@ jobs: aws-region: ${{ secrets.AWS_REGION }} - name: Login to Amazon ECR - if: ${{ github.event_name == 'workflow_dispatch' || steps.client-changes.outputs.client == 'true' }} id: login-ecr uses: aws-actions/amazon-ecr-login@v2 with: mask-password: 'true' - name: Set up Docker Buildx - if: ${{ github.event_name == 'workflow_dispatch' || steps.client-changes.outputs.client == 'true' }} uses: docker/setup-buildx-action@v3 - name: Build, tag, and push Client image to Amazon ECR - if: ${{ github.event_name == 'workflow_dispatch' || steps.client-changes.outputs.client == 'true' }} uses: docker/build-push-action@v6 with: build-args: | @@ -104,7 +101,7 @@ jobs: build_api: needs: [ set_environment_name, trigger_build ] - if: ${{ github.event_name == 'workflow_dispatch' || needs.trigger_build.outputs.build_api == 'true' }} + if: ${{ needs.trigger_build.outputs.build_api == 'true' }} environment: name: ${{ needs.set_environment_name.outputs.env_name }} runs-on: ubuntu-latest @@ -114,7 +111,6 @@ jobs: uses: actions/checkout@v4 - name: Configure AWS credentials - if: ${{ github.event_name == 'workflow_dispatch' || steps.api-changes.outputs.api == 'true' }} uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.PIPELINE_USER_ACCESS_KEY_ID }} @@ -122,18 +118,15 @@ jobs: aws-region: ${{ secrets.AWS_REGION }} - name: Login to Amazon ECR - if: ${{ github.event_name == 'workflow_dispatch' || steps.api-changes.outputs.api == 'true' }} id: login-ecr uses: aws-actions/amazon-ecr-login@v2 with: mask-password: 'true' - name: Set up Docker Buildx - if: ${{ github.event_name == 'workflow_dispatch' || steps.api-changes.outputs.api == 'true' }} uses: docker/setup-buildx-action@v3 - name: Build, tag, and push API image to Amazon ECR - if: ${{ github.event_name == 'workflow_dispatch' || steps.api-changes.outputs.api == 'true' }} uses: docker/build-push-action@v6 with: build-args: | @@ -167,7 +160,7 @@ jobs: build_backoffice: needs: [ set_environment_name, trigger_build ] - if: ${{ github.event_name == 'workflow_dispatch' || needs.trigger_build.outputs.build_backoffice == 'true' }} + if: ${{ needs.trigger_build.outputs.build_backoffice == 'true' }} environment: name: ${{ needs.set_environment_name.outputs.env_name }} runs-on: ubuntu-latest @@ -177,7 +170,6 @@ jobs: uses: actions/checkout@v4 - name: Configure AWS credentials - if: ${{ github.event_name == 'workflow_dispatch' || steps.backoffice-changes.outputs.backoffice == 'true' }} uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.PIPELINE_USER_ACCESS_KEY_ID }} @@ -185,18 +177,15 @@ jobs: aws-region: ${{ secrets.AWS_REGION }} - name: Login to Amazon ECR - if: ${{ github.event_name == 'workflow_dispatch' || steps.backoffice-changes.outputs.backoffice == 'true' }} id: login-ecr uses: aws-actions/amazon-ecr-login@v2 with: mask-password: 'true' - name: Set up Docker Buildx - if: ${{ github.event_name == 'workflow_dispatch' || steps.backoffice-changes.outputs.backoffice == 'true' }} uses: docker/setup-buildx-action@v3 - name: Build, tag, and push Admin image to Amazon ECR - if: ${{ github.event_name == 'workflow_dispatch' || steps.backoffice-changes.outputs.backoffice == 'true' }} uses: docker/build-push-action@v6 with: build-args: |