[Scheduled] Keep demo environment up to date #738
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "[Scheduled] Keep demo environment up to date" | |
on: | |
schedule: | |
# Every 8am | |
- cron: '0 8 * * *' | |
permissions: | |
contents: read | |
security-events: none | |
pull-requests: none | |
actions: none | |
checks: none | |
deployments: none | |
issues: none | |
packages: none | |
repository-projects: none | |
statuses: none | |
jobs: | |
terraform_apply_environment: | |
name: terraform apply demo environment | |
uses: ./.github/workflows/_run-terraform.yml | |
with: | |
workspace: demo | |
terraform_path: environment | |
apply: true | |
specific_path: terraform | |
secrets: inherit | |
seed_dynamodb: | |
name: seed dynamodb | |
uses: ./.github/workflows/_seed-database.yml | |
needs: | |
- terraform_apply_environment | |
secrets: inherit | |
with: | |
workspace: demo | |
force_redeployment: | |
name: force redeployment | |
runs-on: ubuntu-latest | |
needs: | |
- terraform_apply_environment | |
- seed_dynamodb | |
steps: | |
- name: configure AWS credentials for ecs update | |
uses: aws-actions/configure-aws-credentials@97834a484a5ab3c40fa9e2eb40fcf8041105a573 # pin@v1.7.0 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_ACTIONS }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_ACTIONS }} | |
role-to-assume: arn:aws:iam::367815980639:role/opg-use-an-lpa-ci | |
aws-region: eu-west-1 | |
role-duration-seconds: 1800 | |
role-session-name: OPGUseAnLPADevAssumeGithubAction | |
- name: force new deployment | |
run: | | |
aws ecs update-service --cluster demo-use-an-lpa --force-new-deployment --service api-service --region eu-west-1 | |
aws ecs update-service --cluster demo-use-an-lpa --force-new-deployment --service pdf-service --region eu-west-1 | |
aws ecs update-service --cluster demo-use-an-lpa --force-new-deployment --service actor-service --region eu-west-1 | |
aws ecs update-service --cluster demo-use-an-lpa --force-new-deployment --service viewer-service --region eu-west-1 | |
aws ecs update-service --cluster demo-use-an-lpa --force-new-deployment --service admin-service --region eu-west-1 | |
slack_notify: | |
name: notify of result | |
uses: ./.github/workflows/_slack-notification.yml | |
needs: | |
- force_redeployment | |
with: | |
template: successful_demo_release.txt | |
workflow_status: ${{ needs.force_redeployment.result }} | |
workspace: demo | |
secrets: | |
webhook: ${{ secrets.DEV_SLACK_WEB_HOOK }} |