Remove env var and replace with secret #28
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 to Server | |
on: | |
push: | |
branches: | |
- deploytest | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }} | |
- name: Add host | |
run: | | |
ssh-keyscan zenful.cloud > ~/.ssh/known_hosts | |
- name: Set up Docker Compose | |
run: | | |
# Install Docker Compose | |
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 DOCKER_HOST=ssh://[email protected] | |
docker-compose -f ./compose.prod.yaml up -d |