Skip to content

Commit 1957b68

Browse files
committed
fix(ci): fix SSH key format in deploy and add checkout for discord-notify action
- Use env var for SSH key instead of printf to preserve PEM newlines - Add checkout step before local discord-notify action in deployment notifications
1 parent c81bcbe commit 1957b68

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/deploy-beta.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ jobs:
6161
ref: ${{ inputs.source_branch }}
6262

6363
- name: Configure SSH
64+
env:
65+
SSH_PRIVATE_KEY: ${{ secrets.VPS_SSH_KEY }}
6466
run: |
6567
mkdir -p ~/.ssh
66-
printf '%s\n' "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/deploy_key
68+
echo "$SSH_PRIVATE_KEY" > ~/.ssh/deploy_key
6769
chmod 600 ~/.ssh/deploy_key
6870
ssh-keyscan -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts
6971

.github/workflows/deployment-strategy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ jobs:
155155
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
156156

157157
steps:
158+
- name: Checkout code
159+
uses: actions/checkout@v4
160+
158161
- name: Discord Deployment Success Notification
159162
uses: ./.github/actions/discord-notify
160163
if: env.DISCORD_WEBHOOK_URL != ''
@@ -185,6 +188,9 @@ jobs:
185188
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
186189

187190
steps:
191+
- name: Checkout code
192+
uses: actions/checkout@v4
193+
188194
- name: Discord Deployment Failure Notification
189195
uses: ./.github/actions/discord-notify
190196
if: env.DISCORD_WEBHOOK_URL != ''

0 commit comments

Comments
 (0)