Skip to content

Commit

Permalink
Merge pull request #646 from hackforla/add-incubator-github-action-v1
Browse files Browse the repository at this point in the history
Adding Github action to push container to ECR through the Incubator CICD
  • Loading branch information
LoTerence authored Mar 4, 2025
2 parents a46376f + 16a4d5b commit 0c1a518
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: deploy-dev
on:
push:
branches:
- main
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: dev
run: |
docker pull nmatsui/hello-world-api
docker tag nmatsui/hello-world-api $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG

0 comments on commit 0c1a518

Please sign in to comment.