Skip to content

[chore] readme updated #10

[chore] readme updated

[chore] readme updated #10

name: "Publish the image to Docker Hub and Deploy to AWS"
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PWD }}
- name: Build and Push Docker Image
run: |
docker-compose -f docker-compose.prod.yml build
docker-compose -f docker-compose.prod.yml push
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Setup terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.5.0
terraform_working_dir: ./terraform
- name: Terraform init
working_directory: ./terraform

Check failure on line 43 in .github/workflows/build-and-deploy.yml

View workflow run for this annotation

GitHub Actions / Publish the image to Docker Hub and Deploy to AWS

Invalid workflow file

The workflow is not valid. .github/workflows/build-and-deploy.yml (Line: 43, Col: 9): Unexpected value 'working_directory' .github/workflows/build-and-deploy.yml (Line: 47, Col: 9): Unexpected value 'working_directory'
run: terraform init
- name: Terraform plan
working_directory: ./terraform
run: terraform plan
- name: Terraform apply
working_directory: ./terraform
run: terraform apply -auto-approve