Merge pull request #1164 from govuk-one-login/OJ-3050 #374
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: Development Docker build, ECR push, template copy to S3 | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
dockerBuildAndPush: | |
name: Docker build and push | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up AWS creds | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.DEV_GH_ACTIONS_ROLE_ARN }} | |
aws-region: eu-west-2 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
- name: Login to GDS Dev Dynatrace Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: khw46367.live.dynatrace.com | |
username: khw46367 | |
password: ${{ secrets.DYNATRACE_PAAS_TOKEN }} | |
- name: SAM Validate | |
run: sam validate -t deploy/template.yaml | |
- name: Deploy SAM app to ECR | |
uses: govuk-one-login/[email protected] | |
with: | |
artifact-bucket-name: ${{ secrets.DEV_ARTIFACT_BUCKET }} | |
container-sign-kms-key-arn: ${{ secrets.DEV_CONTAINER_SIGNING_ARN }} | |
template-file: deploy/template.yaml | |
dockerfile: dev.Dockerfile | |
role-to-assume-arn: ${{ secrets.DEV_GH_ACTIONS_ROLE_ARN }} | |
ecr-repo-name: ${{ secrets.DEV_ECR_REPOSITORY }} |