Skip to content

Merge pull request #18 from campfire-previews/recording-modal-dynamic… #81

Merge pull request #18 from campfire-previews/recording-modal-dynamic…

Merge pull request #18 from campfire-previews/recording-modal-dynamic… #81

name: Update Feedback Interface
on:
push:
branches:
- main
env:
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.number }}
AWS_REGION: us-east-2 # REGION
ECR_REPOSITORY: feedback-interface-repository # IMAGE_REPOSITORY
ECS_CLUSTER: team5-feedback-interface-cluster # CLUSTER_NAME
PORT: 5173 # PORT
ROLE_ARN: arn:aws:iam::126480444030:role/ecsTaskExecutionRole # EXECUTION_ROLE_ARN
LB_NAME: team5-load-balancer # DEFAULT_LB
SUBNET_NAME: subnet-01cef9a94723b1c34 # DEFAULT_SUBNET
SG_NAME: sg-0dd59509b20ad0cfd # SECURITY_GROUP
ECR_REGISTRY: feedback-interface-repository
permissions:
contents: read
jobs:
deploy_app:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ env.COMMIT_ID }}
- name: Generate GitHub App token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Comment Build Status as Started
uses: hasura/[email protected]
with:
id: status-comment
github-token: ${{ steps.app-token.outputs.token }}
repository: ${{ github.repository }}
number: ${{ env.PR_NUMBER }}
message: "| Status | Message |\n|--------|-------|\n| \U00002692 | Your feedback interface is currently being built and deployed to AWS |"
append: false
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Delete App on Amazon ECS
id: delete-preview
uses: ./.github/actions/delete-feedback
- name: Deploy App to Amazon ECS
id: deploy-preview-app
uses: ./.github/actions/deploy-feedback
- name: Comment Build Status as Completed
uses: hasura/[email protected]
with:
id: status-comment
github-token: ${{ steps.app-token.outputs.token }}
repository: ${{ github.repository }}
number: ${{ env.PR_NUMBER }}
message: "| \U00002705 | Updated feedback interface deployed to ${{ steps.deploy-preview-app.outputs.url }} |"
append: true