Skip to content

Rolling Production Build #118879

Rolling Production Build

Rolling Production Build #118879

Workflow file for this run

name: Rolling Production Build
# The workflow runs every 15 mins and checks if CRM Skills were updated
# It downloads a file from Azure Blob Storage that has "TRUE" or "FALSE" text.
# If the file contains "TRUE", the workflow will trigger the main-trigger-people-deploy.yml
# When build is triggered, the file with "FALSE" will be uploaded to Azure Blob Storage
on:
schedule:
- cron: '*/15 * * * *'
workflow_dispatch:
jobs:
check-and-prepare:
runs-on: ubuntu-latest
steps:
# Download the file that contains "TRUE" if CRM Skills were updated
- name: Check CRM Skills Updated Flag
uses: carlosperate/[email protected]
with:
file-url: ${{ secrets.CRM_SKILLS_FLAG_URL }}
# Check if we need to run a build on production
- name: Determine Deployment Trigger
id: determine-deployment-trigger
run: |
# Check if the file contains "TRUE" string
if grep -q TRUE "CRM_SkillsUpdatedFlag.txt"; then
# Setup variables for the next steps
echo "should_trigger_deploy=TRUE" >> $GITHUB_OUTPUT
echo "branch_name=main" >> $GITHUB_OUTPUT
# Avoid triggering the build again by overriding the file with FALSE
echo FALSE > CRM_SkillsUpdatedFlag.txt
echo "Running Build - CRM Change Detected"
echo "Dispatching main-trigger-people-deploy workflow"
else
echo "should_trigger_deploy=FALSE" >> $GITHUB_OUTPUT
echo "Skipping Build - CRM Data Ok"
fi
shell: bash
# Trigger the other workflow if the CRM data was updated
- name: Build and deploy People
if: steps.determine-deployment-trigger.outputs.should_trigger_deploy == 'TRUE'
uses: benc-uk/workflow-dispatch@v1
with:
workflow: main-trigger-people-deploy.yml
repo: SSWConsulting/SSW.People.Profiles
ref: ${{ steps.determine-deployment-trigger.outputs.branch_name }}
token: "${{ secrets.GITHUB_TOKEN }}"
# If deployment was triggered, upload the file to Azure Blob Storage
# The value of the file should be "FALSE" if deployment was triggered
- name: Update CRM Skills Updated Flag File
uses: fixpoint/[email protected]
if: steps.determine-deployment-trigger.outputs.should_trigger_deploy == 'TRUE'
with:
connection-string: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
name: 'flags'
path: CRM_SkillsUpdatedFlag.txt