-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,19 +16,21 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
- name: Login to AWS ECR | ||
run: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 459672519579.dkr.ecr.us-east-1.amazonaws.com | ||
- name: Install | ||
run: npm install | ||
- name: Build | ||
run: npm run build | ||
- name: Build, tag and push | ||
run: | | ||
cd build | ||
docker build -t ozziest/bookstore:latest . | ||
docker push ozziest/bookstore:latest | ||
- name: Deployment to production | ||
run: sshpass -p "$DO_PASSWORD" ssh -o StrictHostKeyChecking=no -o PreferredAuthentications=password [email protected] 'cd /home/composes/bookstore && docker compose pull && docker compose down && docker compose up -d && docker system prune --force' | ||
docker build -t bookstore-api . | ||
docker tag bookstore-api:latest 459672519579.dkr.ecr.us-east-1.amazonaws.com/bookstore-api:latest | ||
docker push 459672519579.dkr.ecr.us-east-1.amazonaws.com/bookstore-api:latest |