Merge pull request #41 from cul-it/dev #20
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
# When the main branch changes, auto-deploy code in the main branch to the ECS staging server. | |
name: redeploy-stg | |
on: | |
workflow_dispatch: # allow for manually running through Actions tab | |
push: | |
branches: [ main ] # auto-run when main branch changes | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: staging | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
#- uses: actions/checkout@v3 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Force Deploy | |
env: | |
ECR_REPOSITORY: 'ld4p/qa_authority_lookup-stg' | |
ECS_CLUSTER: 'lookup-stg-deploy-cluster' | |
ECS_SERVICE: 'lookup-stg-deploy-service' | |
run: aws ecs update-service --cluster $ECS_CLUSTER --service $ECS_SERVICE --force-new-deployment | |