Skip to content

Commit

Permalink
split workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekkrthakur committed Apr 24, 2024
1 parent 26a8678 commit acbd312
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Docker Hub

on:
push:
branches:
- main

jobs:
dockerhub:
name: Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and Push Docker Image
run: make docker
31 changes: 6 additions & 25 deletions .github/workflows/build_and_push.yml → .github/workflows/ecr.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,19 @@
name: Docker Hub & Amazon ECR
name: Amazon ECR

on:
push:
branches:
- main
workflow_run:
workflows: ["Docker Hub"]
types:
- completed

env:
AWS_REGION: us-east-1
ECR_REPOSITORY: public.ecr.aws/z4c3o6n6
CONTAINER_NAME: autotrain-api
CONTAINER_NAME: autotrain-api

jobs:
dockerhub:
name: Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and Push Docker Image
run: make docker

ecr:
name: Amazon ECR
needs: dockerhub
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
File renamed without changes.

0 comments on commit acbd312

Please sign in to comment.