Skip to content

Commit

Permalink
Update cicd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
akannan1087 authored Apr 9, 2024
1 parent 6475523 commit 624be27
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: cicd-workflow to create docker image and upload into Dockerhub
name: cicd-workflow with slack integration
on:
push:
branches: [ "master" ]
Expand All @@ -7,10 +7,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
- name: Build Docker image
run: |
docker build -t my-docker-repo .
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
role-to-assume: arn:aws:iam::211223789150:role/aws-ecr-role-feb-23
role-scope: 'region'
aws-region: us-east-1
role-duration-seconds: 900 # Adjust this value as needed
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/pythonapp:latest

0 comments on commit 624be27

Please sign in to comment.