Skip to content

Commit

Permalink
Merge pull request #271 from jonfairbanks/fixes/clean-up
Browse files Browse the repository at this point in the history
Push images to AWS ECR
  • Loading branch information
jonfairbanks authored Nov 25, 2024
2 parents 77223f6 + 4ed0493 commit bba941b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/docker-build-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:

docker-build:
name: Docker Build
environment: development
needs: [node-lint, node-audit]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -82,7 +83,7 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build & Push Base Image
- name: Build & Push to DockerHub
id: docker_build
uses: docker/build-push-action@v6
with:
Expand All @@ -95,6 +96,28 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- 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: us-east-1

- name: Login to Amazon ECR
id: ecr-login
uses: aws-actions/amazon-ecr-login@v2
with:
mask-password: 'true'

- name: Build & Push to Amazon ECR
env:
REGISTRY: ${{ steps.ecr-login.outputs.registry }}
REPOSITORY: yo-api
IMAGE_TAG: develop
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
- name: Notify Slack
uses: act10ns/slack@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [opened, synchronize] # Trigger on PR opened and when changes are pushed to the PR

jobs:
npm-audit:
npm-lint:
runs-on: ubuntu-latest

steps:
Expand Down
1 change: 1 addition & 0 deletions src/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage/
*.md
*.test.js
.env*

0 comments on commit bba941b

Please sign in to comment.