Skip to content

dockerized and cicd action #11

dockerized and cicd action

dockerized and cicd action #11

Workflow file for this run

name: Development deployment from Github to AWS
on:
push:
branches:
- testing
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Latest Repo
uses: actions/checkout@master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.prod
push: true
tags: siddharth9903/seistart:latest
# .github/workflows/main.yml continued
- name: Get Timestamp
uses: gerred/actions/current-time@master
id: current-time
- name: Run String Replace
uses: frabert/replace-string-action@master
id: format-time
with:
pattern: '[:\.]+'
string: "${{ steps.current-time.outputs.time }}"
replace-with: "-"
flags: "g"
- name: Generate Deployment Package
run: zip -r deploy.zip * -x "**node_modules**"
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v22
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: Gateway
environment_name: seistart-docker-dev
region: ap-south-1
version_label: ver-${{ github.sha }}
deployment_package: deploy.zip
use_existing_version_if_available: true