Merge pull request #1694 from govuk-one-login/AUT-1466/re-implement-w… #563
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: Build frontend | |
env: | |
AWS_REGION: eu-west-2 | |
#Deployer role is github actions publish code signing role & ECR repo are from Prod AWS Tooling acct | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Assume AWS DEPLOYER role in tooling acct | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
role-to-assume: ${{ secrets.DEPLOYER_ROLE }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- 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: Build, tag, and push frontend | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
ECR_REPOSITORY: ${{ secrets.TOOLING_ECR_FRONTEND_REPO }} | |
IMAGE_TAG: ${{ github.sha }} | |
run: | | |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . | |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | |
- name: Build, tag, and push basic-auth-sidecar | |
working-directory: basic-auth-sidecar | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
ECR_REPOSITORY: ${{ secrets.BASIC_SIDECAR_ECR_REPO }} | |
IMAGE_TAG: ${{ github.sha }} | |
run: | | |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . | |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG |