Skip to content

Commit

Permalink
added .env, needed to get IMAGE_TAG and DOCKERHUB credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosMillanSfC committed Jun 17, 2024
1 parent 72a6127 commit 1d89f1c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .env.prod.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
IMAGE_TAG=${IMAGE_TAG}
COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME}
DOCKERHUB_USERNAME=${DOCKERHUB_USERNAME}
DOCKERHUB_PASSWORD=${DOCKERHUB_PASSWORD}
7 changes: 7 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,12 @@ jobs:
run: |
scp -C -o StrictHostKeyChecking=no -i ./id_rsa ./deployment/bin/deploy.sh ${{ secrets.SSH_CONNECTION_PROD }}:/home/ubuntu/deploy.sh
scp -C -o StrictHostKeyChecking=no -i ./id_rsa ./docker-compose.prod.yml ${{ secrets.SSH_CONNECTION_PROD }}:/usr/src/docker-compose.prod.yml
scp -C -o StrictHostKeyChecking=no -i ./id_rsa ./.env.prod.template ${{ secrets.SSH_CONNECTION_PROD }}:/usr/src/.env
ssh -tt -o StrictHostKeyChecking=no -i ./id_rsa ${{ secrets.SSH_CONNECTION_PROD }} "chmod +x /home/ubuntu/deploy.sh"
ssh -tt -o StrictHostKeyChecking=no -i ./id_rsa ${{ secrets.SSH_CONNECTION_PROD }} "
sed -i '/IMAGE_TAG/c\IMAGE_TAG=${{ github.sha }}' /usr/src/.env
sed -i '/COMPOSE_PROJECT_NAME/c\COMPOSE_PROJECT_NAME=soundcollect-dashboard' /usr/src/.env
sed -i '/DOCKERHUB_USERNAME/c\DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}' /usr/src/.env
sed -i '/DOCKERHUB_PASSWORD/c\DOCKERHUB_PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }}' /usr/src/.env"
ssh -tt -o StrictHostKeyChecking=no -i ./id_rsa ${{ secrets.SSH_CONNECTION_PROD }} "/home/ubuntu/deploy.sh"
4 changes: 0 additions & 4 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,3 @@ services:
environment:
- REPO_USER=${DOCKERHUB_USERNAME}
- REPO_PASS=${DOCKERHUB_PASSWORD}

volumes:
storage:
mysqldata:

0 comments on commit 1d89f1c

Please sign in to comment.