Skip to content

Publish Feature Tests to Dev #184

Publish Feature Tests to Dev

Publish Feature Tests to Dev #184

---
name: 'Publish Feature Tests to Dev'
on:
push:
paths:
- 'feature-tests/**'
- '.github/workflows/manual-publish-feature-tests-to-dev.yaml'
branches:
- main
workflow_dispatch:
inputs:
gitRef:
description: 'Input branch name, commit SHA, or tag'
required: true
type: string
default: main
permissions:
id-token: write
contents: read
jobs:
publish_artifacts:
name: 'Publish Feature Tests Image to Dev'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
with:
ref: ${{ inputs.gitRef }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # pin@6.0.0
with:
role-to-assume: ${{ secrets.DEV_TEST_GH_ACTIONS_ROLE_ARN }}
aws-region: eu-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@376925c9d111252e87ae59691e5a442dd100ef6a # pin@v2.1.3
- name: Build & Publish Docker Image as latest
working-directory: feature-tests/
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.DEV_TEST_ECR_REPOSITORY }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$GITHUB_SHA -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
docker push -a $ECR_REGISTRY/$ECR_REPOSITORY