Skip to content

Commit

Permalink
Remove env var and replace with secret
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottminns committed Nov 12, 2024
1 parent d8ef610 commit 9e44c64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,12 @@ jobs:
curl -L "https://github.com/docker/compose/releases/download/v2.19.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
- name: Set up password
run: |
echo ${{ secrets.DB_PASSWORD }} > db-password.txt
cat db-password.txt
- name: Run Docker Compose
run: |
export DB_PASSWORD=${{ secrets.DB_PASSWORD }}
export DOCKER_HOST=ssh://[email protected]
docker-compose -f ./compose.prod.yaml up -d
# - name: Copy over the docker compose file
# run: |
# scp -o StrictHostKeyChecking=no compose.prod.yaml [email protected]:guestbook/compose.yaml
# - name: Deploy code via SSH
# run: |
# ssh -o StrictHostKeyChecking=no [email protected] "cd guestbook && docker compose up -d"
6 changes: 3 additions & 3 deletions compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ services:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=guestbook
#- POSTGRES_PASSWORD_FILE=/run/secrets/db-password
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_PASSWORD_FILE=/run/secrets/db-password
#- POSTGRES_PASSWORD=${DB_PASSWORD}
expose:
- 5432
healthcheck:
Expand All @@ -84,4 +84,4 @@ volumes:
letsencrypt:
secrets:
db-password:
environment: DB_PASSWORD
file: ./db-password.txt

0 comments on commit 9e44c64

Please sign in to comment.