added deployment scripts #2
This file contains 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 MultiDocker | |
on: | |
push: | |
branches: | |
- main # check your repo, your default branch might be master! | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
- run: docker build -t rallycoding/react-test -f ./client/Dockerfile.dev ./client | |
- run: docker run -e CI=true rallycoding/react-test npm test | |
- run: docker build -t rallycoding/multi-client ./client | |
- run: docker build -t rallycoding/multi-nginx ./nginx | |
- run: docker build -t rallycoding/multi-server ./server | |
- run: docker build -t rallycoding/multi-worker ./worker | |
- run: docker push rallycoding/multi-client | |
- run: docker push rallycoding/multi-nginx | |
- run: docker push rallycoding/multi-server | |
- run: docker push rallycoding/multi-worker | |
- name: Generate deployment package | |
run: zip -r deploy.zip . -x '*.git*' | |
- name: Deploy to EB | |
uses: einaregilsson/beanstalk-deploy@v18 | |
with: | |
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }} | |
aws_secret_key: ${{ secrets.AWS_SECRET_KEY }} | |
application_name: multi-gh | |
environment_name: Multigh-env | |
existing_bucket_name: elasticbeanstalk-us-east-1-923445559289 | |
region: us-east-1 | |
version_label: ${{ github.sha }} | |
deployment_package: deploy.zip |