Skip to content

Commit a46faf8

Browse files
authored
fix: indentation issues in deploy-docker workflow (#88)
1 parent ec8325a commit a46faf8

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

.github/workflows/deploy-docker.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,19 @@ jobs:
9595
ssh-private-key: ${{ secrets.ssh_private_key }}
9696

9797
- name: Add remote host to known_hosts
98-
run: ssh-keyscan -H "${{ inputs.remote_host#*@ }}" >> ~/.ssh/known_hosts
98+
run: |
99+
HOST="${{ inputs.remote_host }}"
100+
HOSTNAME="${HOST#*@}"
101+
ssh-keyscan -H "$HOSTNAME" >> ~/.ssh/known_hosts
99102
100103
- name: Prepare .env for Compose
101104
run: |
102105
cat <<EOF > .env
103-
IMAGE_NAME=${{ inputs.image_name }}
104-
IMAGE_TAG=${{ needs.get-tag.outputs.tag }}
105-
DOCKERHUB_USERNAME=${{ secrets.dockerhub_username }}
106-
DOCKERHUB_PASSWORD=${{ secrets.dockerhub_password }}
107-
EOF
106+
IMAGE_NAME=${{ inputs.image_name }}
107+
IMAGE_TAG=${{ needs.get-tag.outputs.tag }}
108+
DOCKERHUB_USERNAME=${{ secrets.dockerhub_username }}
109+
DOCKERHUB_PASSWORD=${{ secrets.dockerhub_password }}
110+
EOF
108111
109112
- name: Copy compose files
110113
run: |
@@ -113,10 +116,10 @@ EOF
113116
- name: Pull & restart containers
114117
run: |
115118
ssh "${{ inputs.remote_host }}" bash -s <<'REMOTE'
116-
cd "${{ inputs.remote_path }}"
117-
set -e
118-
export \$(grep -v '^#' .env | xargs)
119-
echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
120-
docker compose pull
121-
docker compose up -d
122-
REMOTE
119+
cd "${{ inputs.remote_path }}"
120+
set -e
121+
export $(grep -v '^#' .env | xargs)
122+
echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
123+
docker compose pull
124+
docker compose up -d
125+
REMOTE

0 commit comments

Comments
 (0)