Skip to content

CI/CD scheduled assurances #20

CI/CD scheduled assurances

CI/CD scheduled assurances #20

name: "CI/CD scheduled assurances"
on:
schedule:
- cron: '0 6 * * *' # Runs at 14:00 UTC every day (TODO: update time to 6am UTC)
workflow_dispatch:
env:
AWS_REGION: eu-west-2
jobs:
get-app-version:
name: "Get deployed app version"
runs-on: ubuntu-latest
outputs:
deployed_app_version: ${{ steps.get_deployed_app_version.outputs.deployed_app_version }}
timeout-minutes: 20
environment:
name: "preprod"
permissions:
id-token: write
contents: read
steps:
- name: "Configure AWS credentials for env"
uses: aws-actions/configure-aws-credentials@v5
with:
role-session-name: GitHubActionsSession
role-to-assume: ${{ secrets.IAM_ROLE }}
aws-region: ${{ env.AWS_REGION }}
- name: "Get deployed app version"
id: get_deployed_app_version
run: |
APP_VERSION=$(aws lambda get-function-configuration --function-name gh-vita-${{ secrets.AWS_ACCOUNT_ID }}-server-function | jq -r '.Environment.Variables.APP_VERSION')
echo "deployed_app_version=$APP_VERSION" | tee -a $GITHUB_OUTPUT
acceptance-stage-preprod:
name: "Acceptance stage preprod"
needs: [get-app-version]
uses: ./.github/workflows/stage-5-acceptance.yaml
with:
environment: "preprod"
checkout_ref: ${{ needs.get-app-version.outputs.deployed_app_version }}
cross_browser: true
secrets: inherit
snapshot-stage-preprod:
name: "Snapshot stage preprod"
needs: [acceptance-stage-preprod]
uses: ./.github/workflows/stage-7-snapshot-test.yaml
with:
checkout_ref: ${{ needs.get-app-version.outputs.deployed_app_version }}
secrets: inherit