diff --git a/.github/workflows/create_or_update_portfolio.yaml b/.github/workflows/create_or_update_portfolio.yaml index 1f197dd95..e5c846824 100644 --- a/.github/workflows/create_or_update_portfolio.yaml +++ b/.github/workflows/create_or_update_portfolio.yaml @@ -2,7 +2,7 @@ name: Create or update portfolio on: schedule: - - cron: 0 15 * * 1-5 # launch at 15:00 UTC (10:00 AM EST / 11:00 AM EDT) on weekdays + - cron: 0 15 * * 1-5 jobs: create_or_update_portfolio: name: Create or update portfolio on weekday schedule diff --git a/.github/workflows/launch_infrastructure.yaml b/.github/workflows/launch_infrastructure.yaml index 5c2483078..1065958b6 100644 --- a/.github/workflows/launch_infrastructure.yaml +++ b/.github/workflows/launch_infrastructure.yaml @@ -2,7 +2,7 @@ name: Launch infrastructure on: schedule: - - cron: 0 13 * * 1,2,3,4,5 # launch at 8:00 AM EST + - cron: 0 13 * * 1-5 push: branches: - master @@ -10,47 +10,55 @@ concurrency: group: infrastructure-deployment cancel-in-progress: false jobs: - launch_infrastructure: - name: Launch infrastructure on weekday schedule + build_and_push: + name: Build and push ${{ matrix.service }} runs-on: ubuntu-latest environment: pulumi permissions: id-token: write contents: read + strategy: + matrix: + service: + - datamanager + - portfoliomanager + - equitypricemodel steps: - name: Checkout code uses: actions/checkout@v4 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v5 with: - role-to-assume: ${{ secrets.AWS_INFRASTRUCTURE_ROLE_ARN }} + role-to-assume: ${{ secrets.AWS_IAM_INFRASTRUCTURE_ROLE_ARN }} aws-region: ${{ secrets.AWS_REGION }} - name: Install Flox uses: flox/install-flox-action@v2 - - name: Build data manager image + - name: Build ${{ matrix.service }} image uses: flox/activate-action@v1 with: - command: mask infrastructure images build datamanager server - - name: Push data manager image + command: mask infrastructure images build ${{ matrix.service }} server + - name: Push ${{ matrix.service }} image uses: flox/activate-action@v1 with: - command: mask infrastructure images push datamanager server - - name: Build portfolio manager image - uses: flox/activate-action@v1 - with: - command: mask infrastructure images build portfoliomanager server - - name: Push portfolio manager image - uses: flox/activate-action@v1 - with: - command: mask infrastructure images push portfoliomanager server - - name: Build equity price model image - uses: flox/activate-action@v1 - with: - command: mask infrastructure images build equitypricemodel server - - name: Push equity price model image - uses: flox/activate-action@v1 + command: mask infrastructure images push ${{ matrix.service }} server + deploy: + name: Deploy with Pulumi + needs: build_and_push + runs-on: ubuntu-latest + environment: pulumi + permissions: + id-token: write + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v5 with: - command: mask infrastructure images push equitypricemodel server + role-to-assume: ${{ secrets.AWS_IAM_INFRASTRUCTURE_ROLE_ARN }} + aws-region: ${{ secrets.AWS_REGION }} + - name: Install Flox + uses: flox/install-flox-action@v2 - name: Deploy with Pulumi uses: flox/activate-action@v1 env: diff --git a/.github/workflows/sync_data.yaml b/.github/workflows/sync_data.yaml index 832e82095..5c63f0ab0 100644 --- a/.github/workflows/sync_data.yaml +++ b/.github/workflows/sync_data.yaml @@ -2,7 +2,7 @@ name: Sync data on: schedule: - - cron: 0 10 * * 1-5 # launch at 10:00 UTC (5:00 AM EST / 6:00 AM EDT) + - cron: 0 10 * * 1-5 jobs: fetch_data: name: Sync data on weekday schedule diff --git a/.github/workflows/teardown_infrastructure.yaml b/.github/workflows/teardown_infrastructure.yaml index 6076be43d..b5f9addef 100644 --- a/.github/workflows/teardown_infrastructure.yaml +++ b/.github/workflows/teardown_infrastructure.yaml @@ -2,7 +2,7 @@ name: Teardown infrastructure on: schedule: - - cron: 0 23 * * 1,2,3,4,5 # teardown at 6:00 PM EST + - cron: 0 23 * * 1-5 jobs: teardown_infrastructure: name: Teardown infrastructure on weekday schedule