updating region #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Frontend | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Log in to Docker Hub | |
| run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build Docker image | |
| run: docker build -t mukkipandy/react-test:${{ github.sha }} -f Dockerfile.dev . | |
| - name: Run tests | |
| run: docker run -e CI=true mukkipandy/react-test:${{ github.sha }} npm test | |
| - name: Generate deployment package | |
| run: zip -r deploy.zip . -x '*.git*' | |
| - name: Upload deployment package | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: deploy-package | |
| path: deploy.zip | |
| - name: Deploy to AWS Elastic Beanstalk | |
| uses: einaregilsson/beanstalk-deploy@v18 | |
| with: | |
| region: ap-south-1 | |
| aws_access_key: ${{ secrets.AWS_ACCESS_KEY }} | |
| aws_secret_key: ${{ secrets.AWS_SECRET_KEY }} | |
| application_name: docker-gh | |
| environment_name: Dockergh-env | |
| existing_bucket_name: ${{ secrets.AWS_BUCKET_NAME }} | |
| version_label: ${{ github.sha }} | |
| deployment_package: deploy.zip |