Skip to content

Commit

Permalink
Merge pull request #2 from NASA-IMPACT/push-from-all-branches
Browse files Browse the repository at this point in the history
Build and push Docker images from all branches
  • Loading branch information
sunu authored Jun 5, 2024
2 parents 1b7b500 + 40af331 commit 46bd4f6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ on:
workflow_dispatch:
push:
branches:
- main
- "**" # Push to any branch
paths-ignore:
- "README.md"
- "LICENSE"

env:
REGISTRY: public.ecr.aws
Expand Down Expand Up @@ -53,5 +56,9 @@ jobs:
- name: Push to Amazon ECR
run: |
short_sha=$(echo ${{ github.sha }} | cut -c1-12)
docker push ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:latest
docker push ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:${short_sha}
- name: Push latest tag to Amazon ECR from main branch
if: github.ref == 'refs/heads/main'
run: |
docker push ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:latest

0 comments on commit 46bd4f6

Please sign in to comment.