Skip to content

Development Docker build, ECR push, template copy to S3 #121

Development Docker build, ECR push, template copy to S3

Development Docker build, ECR push, template copy to S3 #121

name: Development Docker build, ECR push, template copy to S3
on:
push:
branches:
- main
workflow_dispatch: # deploy manually
jobs:
dockerBuildAndPush:
name: Docker build and push
runs-on: ubuntu-latest
env:
AWS_REGION: eu-west-2
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Set up AWS creds
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_DEV_DEPLOY_PASSPORTA_FRONT_GITHUB_ACTIONS_ROLE_ARN}}
aws-region: eu-west-2
- name: SAM Validate
run: sam validate --region ${{ env.AWS_REGION }} -t deploy/template.yaml --lint
- 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: "Push signed image to ECR, updated SAM template with image then upload it to the S3 Artifact Bucket"
uses: govuk-one-login/[email protected]
with:
artifact-bucket-name: ${{ secrets.AWS_DEV_DEPLOY_PASSPORTA_FRONT_DEV_ARTIFACT_BUCKET_NAME }}
template-file: deploy/template.yaml
role-to-assume-arn: ${{ secrets.AWS_DEV_DEPLOY_PASSPORTA_FRONT_GITHUB_ACTIONS_ROLE_ARN }}
ecr-repo-name: ${{ secrets.AWS_DEV_DEPLOY_PASSPORTA_FRONT_DEV_ECR_REPOSITORY }}