Skip to content

Merge pull request #691 from hackforla/develop #11

Merge pull request #691 from hackforla/develop

Merge pull request #691 from hackforla/develop #11

Workflow file for this run

name: deploy-stage
on:
push:
branches:
- main
paths-ignore:
- "mkdocs/**"
- "dev/**"
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::035866691871:role/incubator-cicd-civic-tech-jobs
role-session-name: incubator-cicd-civic-tech-jobs
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push the image to Amazon ECR
id: build-push-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: civic-tech-jobs-fullstack
IMAGE_TAG: stage
run: |
docker build -f ./stage/Dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
- name: Redeploy Image in Amazon ECS-Fargate
id: redeploy-service
env:
CLUSTER_NAME: incubator-prod
SERVICE_NAME: civic-tech-jobs-fs-stage
run: |
aws ecs update-service --force-new-deployment --service $SERVICE_NAME --cluster $CLUSTER_NAME