Skip to content

CI/CD scheduled assurances #12

CI/CD scheduled assurances

CI/CD scheduled assurances #12

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 app version"
runs-on: ubuntu-latest
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 app version"
run: |
APP_VERSION=$(aws lambda get-function-configuration --function-name gh-vita-${{ secrets.AWS_ACCOUNT_ID }}-server-function | jq '.Environment.Variables.APP_VERSION')
echo $APP_VERSION
# get-latest-tag:
# name: "Get latest tag"
# runs-on: ubuntu-latest
# outputs:
# tag: ${{ steps.get_tag.outputs.tag }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Get latest tag
# id: get_tag
# run: |
# latest_tag=$(git describe --tags --abbrev=0)
# echo "tag=$latest_tag" >> $GITHUB_OUTPUT
#
# acceptance-stage-preprod:
# name: "Acceptance stage preprod (latest tag)"
# needs: [get-latest-tag]
# uses: ./.github/workflows/stage-5-acceptance.yaml
# with:
# environment: "preprod"
# checkout_ref: ${{ needs.get-latest-tag.outputs.tag }}
# cross_browser: true
# secrets: inherit