Skip to content

Commit

Permalink
Fixed deployment process
Browse files Browse the repository at this point in the history
  • Loading branch information
ozziest committed Dec 2, 2024
1 parent ba9f363 commit 3c2a26b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3c2a26b

Please sign in to comment.